Add IPluginLog#Info

- Shorthand for information log lines, because typing out `Information` is too much.
This commit is contained in:
Kaz Wolfe 2023-09-22 23:22:59 -07:00
parent 3618a510d0
commit d29422bc50
No known key found for this signature in database
GPG key ID: 258813F53A16EBB4
2 changed files with 15 additions and 3 deletions

View file

@ -1,6 +1,4 @@
using System; using Dalamud.IoC;
using Dalamud.IoC;
using Dalamud.IoC.Internal; using Dalamud.IoC.Internal;
using Dalamud.Plugin.Internal.Types; using Dalamud.Plugin.Internal.Types;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
@ -90,6 +88,14 @@ public class ScopedPluginLogService : IServiceType, IPluginLog, IDisposable
/// <inheritdoc /> /// <inheritdoc />
public void Information(Exception? exception, string messageTemplate, params object[] values) => public void Information(Exception? exception, string messageTemplate, params object[] values) =>
this.Write(LogEventLevel.Information, exception, messageTemplate, values); this.Write(LogEventLevel.Information, exception, messageTemplate, values);
/// <inheritdoc/>
public void Info(string messageTemplate, params object[] values) =>
this.Information(messageTemplate, values);
/// <inheritdoc/>
public void Info(Exception? exception, string messageTemplate, params object[] values) =>
this.Information(exception, messageTemplate, values);
/// <inheritdoc /> /// <inheritdoc />
public void Debug(string messageTemplate, params object[] values) => public void Debug(string messageTemplate, params object[] values) =>

View file

@ -76,6 +76,12 @@ public interface IPluginLog
/// <inheritdoc cref="Information(string,object[])"/> /// <inheritdoc cref="Information(string,object[])"/>
/// <param name="exception">An (optional) exception that should be recorded alongside this event.</param> /// <param name="exception">An (optional) exception that should be recorded alongside this event.</param>
void Information(Exception? exception, string messageTemplate, params object[] values); void Information(Exception? exception, string messageTemplate, params object[] values);
/// <inheritdoc cref="Information(string,object[])"/>
void Info(string messageTemplate, params object[] values);
/// <inheritdoc cref="Information(Exception?,string,object[])"/>
void Info(Exception? exception, string messageTemplate, params object[] values);
/// <summary> /// <summary>
/// Log a <see cref="LogEventLevel.Debug" /> message to the Dalamud log for this plugin. This log level should be /// Log a <see cref="LogEventLevel.Debug" /> message to the Dalamud log for this plugin. This log level should be