Table of Contents

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

IReadOnlyCollection<LogLevel>

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

bool

IsEnabled

Gets whether this logger is currently enabled.

bool IsEnabled { get; }

Property Value

bool

Methods

Log(LogEntry)

Logs a structured log entry asynchronously.

Task Log(LogEntry entry)

Parameters

entry LogEntry

The log entry to record.

Returns

Task

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

levels HashSet<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

enabled bool

True to enable, false to disable.