GlobalLogger Class
Namespace: Stride.Core.DiagnosticsAssembly: Stride.Core.dll
A logger that redirect messages to a global handler and handle instantiated MapModuleNameToLogger.
public sealed class GlobalLogger : Logger, ILogger
Name | Description | |
---|---|---|
Properties | ||
RegisteredLoggers | Gets all registered loggers. |
|
Methods | ||
ActivateLog(Action<Logger>) | Activates the log for all loggers using the specified action.. |
|
ActivateLog(String, LogMessageType, LogMessageType, Boolean) | Activates the log for loggers that match a regex pattern on the module name. |
|
ActivateLog(Regex, LogMessageType, LogMessageType, Boolean) | Activates the log for loggers that match a regex pattern on the module name. |
|
GetLogger(String) | Gets the GlobalLogger associated to the specified module. |
|
GetLogger(String, LogMessageType) | Gets the GlobalLogger associated to the specified module. |
|
LogRaw(ILogMessage) | ||
Events | ||
GlobalMessageFilter | Occurs before a message is logged. |
|
GlobalMessageLogged | Occurs when a message is logged. |
Properties
RegisteredLoggers
Gets all registered loggers.
public static Logger[] RegisteredLoggers { get; }
Property Value
Type | Description |
---|---|
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
Type | Name | Description |
---|---|---|
System.Action<Logger> | activator | The activator. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If activator is null |
ActivateLog(String, LogMessageType, LogMessageType, Boolean)
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
Type | Name | Description |
---|---|---|
System.String | regexPatternModule | The regex pattern to match a module name. |
LogMessageType | minimumLevel | The minimum level. |
LogMessageType | maximumLevel | The maximum level. |
System.Boolean | enabledFlag | if set to |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If regexPatternModule is null |
ActivateLog(Regex, LogMessageType, LogMessageType, Boolean)
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
Type | Name | Description |
---|---|---|
System.Text.RegularExpressions.Regex | regexPatternModule | The regex pattern to match a module name. |
LogMessageType | minimumLevel | The minimum level. |
LogMessageType | maximumLevel | The maximum level. |
System.Boolean | enabledFlag | if set to |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If regexPatternModule is null |
GetLogger(String)
Gets the GlobalLogger associated to the specified module.
public static Logger GetLogger(string module)
Parameters
Type | Name | Description |
---|---|---|
System.String | module | The module name. |
Returns
Type | Description |
---|---|
Logger | An instance of a Logger |
Exceptions
Type | Condition |
---|---|
System.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
Type | Name | Description |
---|---|---|
System.String | module | The module name. |
LogMessageType | minimumLevel | Minimum log level (only applied if new logger instance is created) |
Returns
Type | Description |
---|---|
Logger | An instance of a Logger |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If module name is null |
LogRaw(ILogMessage)
protected override void LogRaw(ILogMessage logMessage)
Parameters
Type | Name | Description |
---|---|---|
ILogMessage | logMessage |
Overrides
| Improve this Doc View SourceEvents
GlobalMessageFilter
Occurs before a message is logged.
public static event GlobalLogger.MessageFilterDelegate GlobalMessageFilter
Event Type
Type | Description |
---|---|
GlobalLogger.MessageFilterDelegate |
GlobalMessageLogged
Occurs when a message is logged.
public static event Action<ILogMessage> GlobalMessageLogged
Event Type
Type | Description |
---|---|
System.Action<ILogMessage> |