Table of Contents

Class GlobalLogger

Namespace
Stride.Core.Diagnostics
Assembly
Stride.Core.dll

A logger that redirect messages to a global handler and handle instantiated MapModuleNameToLogger.

public sealed class GlobalLogger : Logger, ILogger
Inheritance
GlobalLogger
Implements
Inherited Members
Extension Methods

Properties

RegisteredLoggers

Gets all registered loggers.

public static Logger[] RegisteredLoggers { get; }

Property Value

Logger[]

The registered loggers.

Methods

ActivateLog(Action<Logger>)

Activates the log for all loggers using the specified action..

public static void ActivateLog(Action<Logger> activator)

Parameters

activator Action<Logger>

The activator.

Exceptions

ArgumentNullException

If activator is null

ActivateLog(string, LogMessageType, LogMessageType, bool)

Activates the log for loggers that match a regex pattern on the module name.

public static void ActivateLog(string regexPatternModule, LogMessageType minimumLevel, LogMessageType maximumLevel = LogMessageType.Fatal, bool enabledFlag = true)

Parameters

regexPatternModule string

The regex pattern to match a module name.

minimumLevel LogMessageType

The minimum level.

maximumLevel LogMessageType

The maximum level.

enabledFlag bool

if set to true enaable the log, else disable.

Exceptions

ArgumentNullException

If regexPatternModule is null

ActivateLog(Regex, LogMessageType, LogMessageType, bool)

Activates the log for loggers that match a regex pattern on the module name.

public static void ActivateLog(Regex regexPatternModule, LogMessageType minimumLevel, LogMessageType maximumLevel = LogMessageType.Fatal, bool enabledFlag = true)

Parameters

regexPatternModule Regex

The regex pattern to match a module name.

minimumLevel LogMessageType

The minimum level.

maximumLevel LogMessageType

The maximum level.

enabledFlag bool

if set to true enaable the log, else disable.

Exceptions

ArgumentNullException

If regexPatternModule is null

GetLogger(string)

Gets the GlobalLogger associated to the specified module.

public static Logger GetLogger(string module)

Parameters

module string

The module name.

Returns

Logger

An instance of a Logger

Exceptions

ArgumentNullException

If module name is null

GetLogger(string, LogMessageType)

Gets the GlobalLogger associated to the specified module.

public static Logger GetLogger(string module, LogMessageType minimumLevel)

Parameters

module string

The module name.

minimumLevel LogMessageType

Minimum log level (only applied if new logger instance is created)

Returns

Logger

An instance of a Logger

Exceptions

ArgumentNullException

If module name is null

LogRaw(ILogMessage)

Internal method used to log a message. All Info, Debug, Error...etc. methods are calling this method.

protected override void LogRaw(ILogMessage logMessage)

Parameters

logMessage ILogMessage

The log message.

Events

GlobalMessageFilter

Occurs before a message is logged.

public static event GlobalLogger.MessageFilterDelegate GlobalMessageFilter

Event Type

GlobalLogger.MessageFilterDelegate

GlobalMessageLogged

Occurs when a message is logged.

public static event Action<ILogMessage> GlobalMessageLogged

Event Type

Action<ILogMessage>