Logging Class¶
Definition¶
namespace Sharplog
Methods¶
| Name | Modifiers | Returns |
|---|---|---|
| Initialize() | public static |
|
| Dispose() | public static |
|
| Log(LogLevel, object, string, Exception, bool) | public static |
|
| LogDebug(object, string, Exception, bool) | public static |
|
| LogTrace(object, string, Exception, bool) | public static |
|
| LogInfo(object, string, Exception, bool) | public static |
|
| LogWarning(object, string, Exception, bool) | public static |
|
| LogError(object, string, Exception, bool) | public static |
|
| LogFatal(object, string, Exception, bool) | public static |
Methods¶
Initialize()¶
-
Initializes the logger. The logger will automatically initialize itself with the first log function call. Use this function if you want to initialize before you start logging.
Dispose()¶
-
Releases resources and logs all remaining logs. Should be called before exiting the program.
Log(LogLevel, object, string, Exception, bool)¶
-
Logs a log message.
Parameter¶
levelLogLevel ·- The level of the log.
messageobject ·- The message of the log. Gets converted to a string using
.toString(). tagstring ·null- The tag of the log.
exceptionException ·null- The exception of the log.
stackTracebool ·false- Wether the log should include the stack trace.
LogDebug(object, string, Exception, bool)¶
-
Logs a debug log message.
Parameter¶
messageobject ·- The message of the log. Gets converted to a string using
.toString(). tagstring ·null- The tag of the log.
exceptionException ·null- The exception of the log.
stackTracebool ·false- Wether the log should include the stack trace.
LogTrace(object, string, Exception, bool)¶
-
Logs a trace log message.
Parameter¶
messageobject ·- The message of the log. Gets converted to a string using
.toString(). tagstring ·null- The tag of the log.
exceptionException ·null- The exception of the log.
stackTracebool ·false- Wether the log should include the stack trace.
LogInfo(object, string, Exception, bool)¶
-
Logs an information log message.
Parameter¶
messageobject ·- The message of the log. Gets converted to a string using
.toString(). tagstring ·null- The tag of the log.
exceptionException ·null- The exception of the log.
stackTracebool ·false- Wether the log should include the stack trace.
LogWarning(object, string, Exception, bool)¶
-
Logs a warning log message.
Parameter¶
messageobject ·- The message of the log. Gets converted to a string using
.toString(). tagstring ·null- The tag of the log.
exceptionException ·null- The exception of the log.
stackTracebool ·false- Wether the log should include the stack trace.
LogError(object, string, Exception, bool)¶
-
Logs an error log message.
Parameter¶
messageobject ·- The message of the log. Gets converted to a string using
.toString(). tagstring ·null- The tag of the log.
exceptionException ·null- The exception of the log.
stackTracebool ·false- Wether the log should include the stack trace.
LogFatal(object, string, Exception, bool)¶
-
Logs a fatal log message and exits the program with code 1.