NanoByte.Common
Static Public Member Functions | Properties | List of all members
NanoByte.Common.Log Class Reference

Sends log messages to custom handlers or the Console. Additionally writes to System.Diagnostics.Debug, an in-memory buffer and a plain text file. More...

Static Public Member Functions

static void Debug ([NotNull] string message)
 Writes information to help developers diagnose problems to the log. More...
 
static void Debug ([NotNull] Exception ex)
 Writes an exception as an Debug(string). More...
 
static void Info ([NotNull] string message)
 Writes nice-to-know information to the log. More...
 
static void Info ([NotNull] Exception ex)
 Writes an exception's message as a Info(string). More...
 
static void Warn ([NotNull] string message)
 Writes a warning that doesn't have to be acted upon immediately to the log. More...
 
static void Warn ([NotNull] Exception ex)
 Writes an exception's message as a Warn(string). More...
 
static void Error ([NotNull] string message)
 Writes a critical error that should be attended to to the log. More...
 
static void Error ([NotNull] Exception ex)
 Writes an exception's message as an Error(string). More...
 
static void PrintToConsole (LogSeverity severity, [NotNull] string message)
 Prints a log entry to the Console. More...
 

Properties

static LogEntryEventHandler 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. More...
 
static string Content [get]
 Collects all log entries from this application session. More...
 

Detailed Description

Sends log messages to custom handlers or the Console. Additionally writes to System.Diagnostics.Debug, an in-memory buffer and a plain text file.

Member Function Documentation

◆ Debug() [1/2]

static void NanoByte.Common.Log.Debug ( [NotNull] string  message)
static

Writes information to help developers diagnose problems to the log.

◆ Debug() [2/2]

static void NanoByte.Common.Log.Debug ( [NotNull] Exception  ex)
inlinestatic

Writes an exception as an Debug(string).

◆ Error() [1/2]

static void NanoByte.Common.Log.Error ( [NotNull] string  message)
static

Writes a critical error that should be attended to to the log.

◆ Error() [2/2]

static void NanoByte.Common.Log.Error ( [NotNull] Exception  ex)
inlinestatic

Writes an exception's message as an Error(string).

Also sends the entire exception to Debug(Exception).

◆ Info() [1/2]

static void NanoByte.Common.Log.Info ( [NotNull] string  message)
static

Writes nice-to-know information to the log.

◆ Info() [2/2]

static void NanoByte.Common.Log.Info ( [NotNull] Exception  ex)
inlinestatic

Writes an exception's message as a Info(string).

Also sends the entire exception to Debug(Exception).

◆ PrintToConsole()

static void NanoByte.Common.Log.PrintToConsole ( LogSeverity  severity,
[NotNull] string  message 
)
inlinestatic

Prints a log entry to the Console.

Parameters
severityThe type/severity of the entry.
messageThe message text of the entry.

◆ Warn() [1/2]

static void NanoByte.Common.Log.Warn ( [NotNull] string  message)
static

Writes a warning that doesn't have to be acted upon immediately to the log.

◆ Warn() [2/2]

static void NanoByte.Common.Log.Warn ( [NotNull] Exception  ex)
inlinestatic

Writes an exception's message as a Warn(string).

Also sends the entire exception to Debug(Exception).

Property Documentation

◆ Content

string NanoByte.Common.Log.Content
staticget

Collects all log entries from this application session.

◆ Handler

LogEntryEventHandler NanoByte.Common.Log.Handler
staticaddremove

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.


The documentation for this class was generated from the following file: