Added a event thats gets fired when the logLevel is disabled
This commit is contained in:
11
README.md
11
README.md
@@ -95,6 +95,7 @@ namespace EonaCat.Logger.Advanced
|
||||
// Create and configure a LogManager for logging.
|
||||
_logManager = new LogManager(new LoggerSettings { RemoveMessagePrefix = true });
|
||||
_logManager.OnException += _logManager_OnException;
|
||||
_logManager.OnLogLevelDisabled += _logManager_OnLogLevelDisabled;
|
||||
_logManager.Settings.FileLoggerOptions.FileNamePrefix = "advanced";
|
||||
_logManager.Settings.UseLocalTime = true;
|
||||
_logManager.Settings.FileLoggerOptions.UseLocalTime = true;
|
||||
@@ -106,6 +107,16 @@ namespace EonaCat.Logger.Advanced
|
||||
|
||||
// Event handler for LogManager exceptions, writes messages to the console.
|
||||
private static void _logManager_OnException(object? sender, ErrorMessage e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
if (e.Exception != null)
|
||||
{
|
||||
Console.WriteLine(e.Exception);
|
||||
}
|
||||
}
|
||||
|
||||
// Event handler for LogManager loglevel disabled notifications, writes messages to the console.
|
||||
private static void _logManager_OnLogLevelDisabled(object? sender, ErrorMessage e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
if (e.Exception != null)
|
||||
|
||||
Reference in New Issue
Block a user