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
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
stringThe regex pattern to match a module name.
minimumLevel
LogMessageTypeThe minimum level.
maximumLevel
LogMessageTypeThe maximum level.
enabledFlag
boolif 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
RegexThe regex pattern to match a module name.
minimumLevel
LogMessageTypeThe minimum level.
maximumLevel
LogMessageTypeThe maximum level.
enabledFlag
boolif 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
stringThe module name.
Returns
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
stringThe module name.
minimumLevel
LogMessageTypeMinimum log level (only applied if new logger instance is created)
Returns
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
ILogMessageThe log message.
Events
GlobalMessageFilter
Occurs before a message is logged.
public static event GlobalLogger.MessageFilterDelegate GlobalMessageFilter
Event Type
GlobalMessageLogged
Occurs when a message is logged.
public static event Action<ILogMessage> GlobalMessageLogged