BotSharp/src/Infrastructure/BotSharp.Logger/Hooks/VerboseLogHook.cs

21 lines
507 B
C#
Raw Normal View History

2023-11-29 23:23:14 +00:00
namespace BotSharp.Logger.Hooks;
public class VerboseLogHook : IVerboseLogHook
{
private readonly ConversationSetting _convSettings;
private readonly ILogger<VerboseLogHook> _logger;
public VerboseLogHook(ConversationSetting convSettings, ILogger<VerboseLogHook> logger)
{
_convSettings = convSettings;
_logger = logger;
}
public void GenerateLog(string text)
{
if (!_convSettings.ShowVerboseLog) return;
_logger.LogInformation(text);
}
}