Class WarfareLogger
public class WarfareLogger : ILogger
- Inheritance
-
WarfareLogger
- Implements
- Inherited Members
- Extension Methods
-
TranslationLoggingExtensions.LogInformation<T0, T1>(ILogger, Exception, Translation<T0, T1>, T0, T1)TranslationLoggingExtensions.Log<T0, T1, T2>(ILogger, LogLevel, Translation<T0, T1, T2>, T0, T1, T2)WarfareLoggingExtensions.Log(ILogger, LogLevel, EventId, string, object?, object?, object?, object?)WarfareLoggingExtensions.LogWarning(ILogger, EventId, Exception?, string, object?, object?, object?)WarfareLoggingExtensions.LogWarning(ILogger, EventId, WarfareWarningLoggerInterpolatedStringHandler)
Constructors
WarfareLogger(string, WarfareLoggerProvider, ITranslationValueFormatter?)
public WarfareLogger(string categoryName, WarfareLoggerProvider loggerProvider, ITranslationValueFormatter? formatter)
Parameters
categoryNamestringloggerProviderWarfareLoggerProviderformatterITranslationValueFormatter
Methods
BeginScope<TState>(TState)
Begins a logical operation scope.
[MustUseReturnValue("Must be disposed after use to cancel the scope.")]
public IDisposable BeginScope<TState>(TState state) where TState : notnull
Parameters
stateTStateThe identifier for the scope.
Returns
- IDisposable
An IDisposable that ends the logical operation scope on dispose.
Type Parameters
TStateThe type of the state to begin scope for.
CheckForMessageLog(ref LogLevel, ref string)
Removes the value added by ICommandUser to override when Information is disabled.
public static void CheckForMessageLog(ref LogLevel logLevel, ref string message)
Parameters
IsEnabled(LogLevel)
Checks if the given logLevel is enabled.
[Pure]
public bool IsEnabled(LogLevel logLevel)
Parameters
logLevelLogLevelLevel to be checked.
Returns
Log<TState>(LogLevel, EventId, TState, Exception?, Func<TState, Exception?, string>)
Writes a log entry.
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Parameters
logLevelLogLevelEntry will be written on this level.
eventIdEventIdId of the event.
stateTStateThe entry to be written. Can be also an object.
exceptionExceptionThe exception related to this entry.
formatterFunc<TState, Exception, string>Function to create a string message of the
stateandexception.
Type Parameters
TStateThe type of the object to be written.