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¶
level
LogLevel ·- The level of the log.
message
object ·- The message of the log. Gets converted to a string using
.toString()
. tag
string ·null
- The tag of the log.
exception
Exception ·null
- The exception of the log.
stackTrace
bool ·false
- Wether the log should include the stack trace.
LogDebug(object, string, Exception, bool)¶
-
Logs a debug log message.
Parameter¶
message
object ·- The message of the log. Gets converted to a string using
.toString()
. tag
string ·null
- The tag of the log.
exception
Exception ·null
- The exception of the log.
stackTrace
bool ·false
- Wether the log should include the stack trace.
LogTrace(object, string, Exception, bool)¶
-
Logs a trace log message.
Parameter¶
message
object ·- The message of the log. Gets converted to a string using
.toString()
. tag
string ·null
- The tag of the log.
exception
Exception ·null
- The exception of the log.
stackTrace
bool ·false
- Wether the log should include the stack trace.
LogInfo(object, string, Exception, bool)¶
-
Logs an information log message.
Parameter¶
message
object ·- The message of the log. Gets converted to a string using
.toString()
. tag
string ·null
- The tag of the log.
exception
Exception ·null
- The exception of the log.
stackTrace
bool ·false
- Wether the log should include the stack trace.
LogWarning(object, string, Exception, bool)¶
-
Logs a warning log message.
Parameter¶
message
object ·- The message of the log. Gets converted to a string using
.toString()
. tag
string ·null
- The tag of the log.
exception
Exception ·null
- The exception of the log.
stackTrace
bool ·false
- Wether the log should include the stack trace.
LogError(object, string, Exception, bool)¶
-
Logs an error log message.
Parameter¶
message
object ·- The message of the log. Gets converted to a string using
.toString()
. tag
string ·null
- The tag of the log.
exception
Exception ·null
- The exception of the log.
stackTrace
bool ·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.