C# Class VoidLib.Common.Logging

This class handles all logging done for OpenBot. From simple output, to writing to files, to logging exceptions and user messages. It is event based, and thread safe.
Mostra file Open project: andrewmunro/Void

Private Properties

Property Type Description
Events_OnBotShutdown void
InvokeOnDebug void
InvokeOnWrite void
Logging System
_WriteQueue void

Public Methods

Method Description
LogException ( Exception ex ) : void

Logs the specified exception into the log queue.

LogMessage ( string format ) : void

Logs the specified message to the logging queue. This will not fire any message events. It will go straight to the log file without question.

Write ( Color color, string format ) : void

Writes the specified message to the message queue.

Write ( string format ) : void

Writes the specified message to the message queue.

WriteDebug ( Color color, string format ) : void

Writes the debug message in the specific color. Debug messages are not shown to the end user by default. (They can be turned on via settings)

WriteDebug ( string format ) : void

Writes the specified debug message to the message queue. [Default Color: Red] Debug messages are not shown to the end user by default. (They can be turned on via settings)

WriteException ( Color color, Exception ex ) : void

Writes the specified exception to the message queue. Debug messages are not shown to the end user by default. (They can be turned on via settings)

WriteException ( Exception ex ) : void

Writes the specified exception to the message queue. [Default Color: Red] Debug messages are not shown to the end user by default. (They can be turned on via settings)

Private Methods

Method Description
Events_OnBotShutdown ( object sender, EventArgs e ) : void
InvokeOnDebug ( string message, Color col ) : void
InvokeOnWrite ( string message, Color col ) : void
Logging ( ) : System
_WriteQueue ( object blocking ) : void

Method Details

LogException() public static method

Logs the specified exception into the log queue.
public static LogException ( Exception ex ) : void
ex System.Exception The exception to be logged.
return void

LogMessage() public static method

Logs the specified message to the logging queue. This will not fire any message events. It will go straight to the log file without question.
public static LogMessage ( string format ) : void
format string The format param of string.Format
return void

Write() public static method

Writes the specified message to the message queue.
public static Write ( Color color, string format ) : void
color Color The color to write the message in.
format string The format.
return void

Write() public static method

Writes the specified message to the message queue.
public static Write ( string format ) : void
format string The format.
return void

WriteDebug() public static method

Writes the debug message in the specific color. Debug messages are not shown to the end user by default. (They can be turned on via settings)
public static WriteDebug ( Color color, string format ) : void
color Color The color to write in.
format string
return void

WriteDebug() public static method

Writes the specified debug message to the message queue. [Default Color: Red] Debug messages are not shown to the end user by default. (They can be turned on via settings)
public static WriteDebug ( string format ) : void
format string The format.
return void

WriteException() public static method

Writes the specified exception to the message queue. Debug messages are not shown to the end user by default. (They can be turned on via settings)
public static WriteException ( Color color, Exception ex ) : void
color Color The color to write the message in.
ex System.Exception The exception that will be logged.
return void

WriteException() public static method

Writes the specified exception to the message queue. [Default Color: Red] Debug messages are not shown to the end user by default. (They can be turned on via settings)
public static WriteException ( Exception ex ) : void
ex System.Exception The exception that will be logged.
return void