Add Scoped Plugin Log Service (#1341)

Adds a new `IPluginLog` service to Dalamud, which provides scoped logging on a per-plugin basis. This improves log performance for plugins, and paves the way for per-plugin log levels.

* Plugins must opt in to enable verbose logging by setting `IPluginLog.MinimumLogLevel` to `LogEventLevel.Verbose`. This option is automatically enabled for dev plugins and is currently not persisted.
    * All release plugins will default to `Debug` as their lowest allowed log level.
    * This setting does not override the global log level set in Dalamud.
This commit is contained in:
KazWolfe 2023-09-07 10:58:41 -07:00 committed by GitHub
parent 1dbf93e428
commit 8c51bbf0f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 263 additions and 67 deletions

View file

@ -6,6 +6,7 @@ using Dalamud.Game.Command;
using Dalamud.Interface.Windowing;
using Dalamud.Logging;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
using Dalamud.Utility;
using Serilog;
@ -56,7 +57,7 @@ namespace Dalamud.CorePlugin
/// </summary>
/// <param name="pluginInterface">Dalamud plugin interface.</param>
/// <param name="log">Logging service.</param>
public PluginImpl(DalamudPluginInterface pluginInterface, PluginLog log)
public PluginImpl(DalamudPluginInterface pluginInterface, IPluginLog log)
{
try
{