Class Log
Sends log messages to custom handlers or the console.
Additionally writes to Debug, an in-memory buffer and a plain text file.
Assembly: NanoByte.Common.dll
Syntax
public static class Log : Object
Properties
Content
Collects all log entries from this application session.
Declaration
public static string Content { get; }
Property Value
Methods
add_Handler(LogEntryEventHandler)
Declaration
public static void add_Handler(LogEntryEventHandler value)
Parameters
Debug(String, Exception)
Writes information to help developers diagnose problems to the log.
Declaration
public static void Debug(string message, Exception exception = null)
Parameters
Error(String, Exception)
Writes a critical error that should be attended to the log.
Declaration
public static void Error(string message, Exception exception = null)
Parameters
Info(String, Exception)
Writes nice-to-know information to the log.
Declaration
public static void Info(string message, Exception exception = null)
Parameters
remove_Handler(LogEntryEventHandler)
Declaration
public static void remove_Handler(LogEntryEventHandler value)
Parameters
Warn(String, Exception)
Writes a warning that doesn't have to be acted upon immediately to the log.
Declaration
public static void Warn(string message, Exception exception = null)
Parameters
Events
Handler
Invoked when a new entry is added to the log.
Only the newest (last) registered handler is invoked.
Console output is used as a fallback if no handlers are registered.
Declaration
public static event LogEntryEventHandler Handler
Event Type