Class Logger
- Namespace
- Stride.Core.Diagnostics
- Assembly
- Stride.Core.dll
Base implementation for ILogger.
- Inheritance
-
Logger
- Implements
- Derived
- Extension Methods
Constructors
Logger()
Initializes a new instance of the Logger class.
Fields
EnableTypes
Field Value
- bool[]
IsDebugEnabled
True if the debug level is enabled at a global level
Field Value
IsVerboseEnabled
True if the verbose level is enabled at a global level
Field Value
Properties
HasErrors
Gets or sets a value indicating whether this instance has errors.
Property Value
- bool
true
if this instance has errors; otherwise,false
.
MinimumLevelEnabled
Gets the minimum level enabled from the config file. Can be overridden by the user.
Property Value
Module
Gets the module name. read-only.
Property Value
- string
The module name.
Methods
ActivateLog(LogMessageType, LogMessageType, bool)
Activates the log for this logger for a range of Log
public void ActivateLog(LogMessageType fromLevel, LogMessageType toLevel = LogMessageType.Fatal, bool enabledFlag = true)
Parameters
fromLevel
LogMessage Type The lowest inclusive level to log for.
toLevel
LogMessage Type The highest inclusive level to log for.
enabledFlag
boolif set to
true
this will enable the log, false otherwise. Default is true.
Remarks
Outside the specified range the log message type are disabled (!enabledFlag).
ActivateLog(LogMessageType, bool)
Activates the log for this logger for a specific Log
Parameters
type
LogMessage Type The type.
enabledFlag
boolif set to
true
[enabled flag].
Remarks
All other activated type are leaved intact.
Activated(LogMessageType)
Returns a boolean indicating if a particular Log
Parameters
type
LogMessage Type The type.
Returns
- bool
True if the log is activated, otherwise false.
Debug(string, CallerInfo)
Logs the specified debug message.
Parameters
message
stringThe debug message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Debug(string, Exception, CallerInfo)
Logs the specified debug message with an exception.
Parameters
message
stringThe debug message.
exception
ExceptionAn exception to log with the message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Error(string, CallerInfo)
Logs the specified error message.
Parameters
message
stringThe error message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Error(string, Exception, CallerInfo)
Logs the specified error message with an exception.
Parameters
message
stringThe error message.
exception
ExceptionAn exception to log with the message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Fatal(string, CallerInfo)
Logs the specified fatal message.
Parameters
message
stringThe fatal message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Fatal(string, Exception, CallerInfo)
Logs the specified fatal message with an exception.
Parameters
message
stringThe fatal message.
exception
ExceptionAn exception to log with the message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Info(string, CallerInfo)
Logs the specified info message.
Parameters
message
stringThe info message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Info(string, Exception, CallerInfo)
Logs the specified info message with an exception.
Parameters
message
stringThe info message.
exception
ExceptionAn exception to log with the message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Log(ILogMessage)
Logs the specified log message.
Parameters
logMessage
ILogMessage The log message.
LogRaw(ILogMessage)
Internal method used to log a message. All Info, Debug, Error...etc. methods are calling this method.
Parameters
logMessage
ILogMessage The log message.
Verbose(string, CallerInfo)
Logs the specified verbose message.
Parameters
message
stringThe verbose message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Verbose(string, Exception, CallerInfo)
Logs the specified verbose message with an exception.
Parameters
message
stringThe verbose message.
exception
ExceptionAn exception to log with the message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Warning(string, CallerInfo)
Logs the specified warning message.
Parameters
message
stringThe warning message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Warning(string, Exception, CallerInfo)
Logs the specified warning message with an exception.
Parameters
message
stringThe warning message.
exception
ExceptionAn exception to log with the message.
callerInfo
CallerInfo Information about the caller. Default is null, otherwise use Get(string,
string, .int)
Events
MessageLogged
Occurs when a message is logged.