mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 06:13:40 +01:00
Expose Serilog API to plugins
This commit is contained in:
parent
3c18814a66
commit
621fd17e1d
3 changed files with 13 additions and 7 deletions
|
|
@ -41,6 +41,9 @@ internal class ScopedPluginLogService : IServiceType, IPluginLog
|
||||||
this.Logger = loggerConfiguration.CreateLogger();
|
this.Logger = loggerConfiguration.CreateLogger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public ILogger Logger { get; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public LogEventLevel MinimumLogLevel
|
public LogEventLevel MinimumLogLevel
|
||||||
{
|
{
|
||||||
|
|
@ -48,11 +51,6 @@ internal class ScopedPluginLogService : IServiceType, IPluginLog
|
||||||
set => this.levelSwitch.MinimumLevel = value;
|
set => this.levelSwitch.MinimumLevel = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a logger that may be exposed to plugins some day.
|
|
||||||
/// </summary>
|
|
||||||
public ILogger Logger { get; }
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void Fatal(string messageTemplate, params object[] values) =>
|
public void Fatal(string messageTemplate, params object[] values) =>
|
||||||
this.Write(LogEventLevel.Fatal, null, messageTemplate, values);
|
this.Write(LogEventLevel.Fatal, null, messageTemplate, values);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Serilog.Events;
|
using Serilog;
|
||||||
|
using Serilog.Events;
|
||||||
|
|
||||||
#pragma warning disable CS1573 // See https://github.com/dotnet/roslyn/issues/40325
|
#pragma warning disable CS1573 // See https://github.com/dotnet/roslyn/issues/40325
|
||||||
|
|
||||||
|
|
@ -9,6 +10,12 @@ namespace Dalamud.Plugin.Services;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IPluginLog
|
public interface IPluginLog
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a Serilog ILogger instance for this plugin. This is the entrypoint for plugins that wish to use more
|
||||||
|
/// advanced logging functionality.
|
||||||
|
/// </summary>
|
||||||
|
public ILogger Logger { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the minimum log level that will be recorded from this plugin to Dalamud's logs. This may be set
|
/// Gets or sets the minimum log level that will be recorded from this plugin to Dalamud's logs. This may be set
|
||||||
/// by either the plugin or by Dalamud itself.
|
/// by either the plugin or by Dalamud itself.
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
<Reference Include="ImGuiScene" Private="false" />
|
<Reference Include="ImGuiScene" Private="false" />
|
||||||
<Reference Include="Lumina" Private="false" />
|
<Reference Include="Lumina" Private="false" />
|
||||||
<Reference Include="Lumina.Excel" Private="false" />
|
<Reference Include="Lumina.Excel" Private="false" />
|
||||||
|
<Reference Include="Serilog" Private="false" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="Message" BeforeTargets="BeforeBuild">
|
<Target Name="Message" BeforeTargets="BeforeBuild">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue