C# Класс 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.
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
Events_OnBotShutdown void
InvokeOnDebug void
InvokeOnWrite void
Logging System
_WriteQueue void

Открытые методы

Метод Описание
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)

Приватные методы

Метод Описание
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

Описание методов

LogException() публичный статический Метод

Logs the specified exception into the log queue.
public static LogException ( Exception ex ) : void
ex System.Exception The exception to be logged.
Результат void

LogMessage() публичный статический Метод

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
Результат void

Write() публичный статический Метод

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.
Результат void

Write() публичный статический Метод

Writes the specified message to the message queue.
public static Write ( string format ) : void
format string The format.
Результат void

WriteDebug() публичный статический Метод

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
Результат void

WriteDebug() публичный статический Метод

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.
Результат void

WriteException() публичный статический Метод

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.
Результат void

WriteException() публичный статический Метод

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.
Результат void