Logger Class
Namespace: Yubico.Core.Logging Assembly: Yubico.Core.dllA concrete logger implementation used by Yubico .NET-based libraries.
[Obsolete("Obsolete, use equivalent ILogger method, or view the changelog for further instruction.")]
public sealed class Logger : ILogger
Implements
Remarks
This class builds on top of the standard ILogger interface used by the Microsoft.Extensions logging library. This is a meta-library for interoperating with different concrete logging implementations such as NLog, Serilog, or .NET's built in EventPipe system.
Methods for logging potentially sensitive information are present. These methods are disabled for Release builds, resulting in a no-op for anything other than a Debug build of this library.
Extension methods can be used to add further conveniences to the logging interface. For example, if you wanted to log a platform error code in a uniform way, you could introduce a `LogPlatformError` extension that takes care of formatting the error and calling one of the existing log methods.
Methods
Name | Description |
---|---|
BeginScope<TState>(TState) | Begins a logical operation scope to group log messages together. |
IsEnabled(LogLevel) | Checks whether the given |
Log<TState>(LogLevel, EventId, TState, Exception?, Func<TState, Exception?, string>) | Writes an entry to the log. |