Interface ILogger
- Namespace
- FishMMO.Logging
- Assembly
- FishMMO-Logger.dll
Defines the interface for a logging service.
public interface ILogger : IDisposable
- Inherited Members
Properties
AllowedLevels
Gets the set of log levels that this logger is allowed to process. If a log entry's level is not in this set, it will be ignored by this logger.
IReadOnlyCollection<LogLevel> AllowedLevels { get; }
Property Value
HandlesConsoleParts
Gets a value indicating whether this logger is specifically designed to handle console output from the Log.WritePartsToConsole method. If true, this logger will be excluded from general dispatch when WritePartsToConsole has already sent output to the primary console formatter.
bool HandlesConsoleParts { get; }
Property Value
IsEnabled
Gets whether this logger is currently enabled.
bool IsEnabled { get; }
Property Value
Methods
Log(LogEntry)
Logs a structured log entry asynchronously.
Task Log(LogEntry entry)
Parameters
entryLogEntryThe log entry to record.
Returns
SetAllowedLevels(HashSet<LogLevel>)
Sets the specific log levels that this logger is allowed to process. Setting this will replace any previously configured allowed levels.
void SetAllowedLevels(HashSet<LogLevel> levels)
Parameters
levelsHashSet<LogLevel>A HashSet containing the LogLevels to allow. If null or empty, no levels will be allowed.
SetEnabled(bool)
Sets the enabled state of the logger.
void SetEnabled(bool enabled)
Parameters
enabledboolTrue to enable, false to disable.