C# Класс BF2Statistics.Logging.LogWriter

Provides an object wrapper for a file that is used to store LogMessage's into. Uses a Multi-Thread safe Queueing system, and provides full Asynchronous writing and flushing
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
LoggingEnabled bool

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

Метод Описание
ClearLog ( ) : void

Queues the underlying log writer to empty the logfile before appending any more messages to it. Messages that are awaiting to be written to the log file are NOT removed from Queue

Dispose ( ) : void
LogWriter ( string FileLocation, bool Truncate = false, int TruncateLen = 2097152 ) : System

Creates a new Log Writter instance

Write ( string message ) : void

Adds a message to the queue, to be written to the log file

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

Метод Описание
FlushLog ( ) : void

Flushes the Queue to the physical log file

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

ClearLog() публичный Метод

Queues the underlying log writer to empty the logfile before appending any more messages to it. Messages that are awaiting to be written to the log file are NOT removed from Queue
public ClearLog ( ) : void
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

LogWriter() публичный Метод

Creates a new Log Writter instance
public LogWriter ( string FileLocation, bool Truncate = false, int TruncateLen = 2097152 ) : System
FileLocation string The location of the logfile. If the file doesnt exist, /// It will be created.
Truncate bool If set to true and the logfile is over XX size, it will be truncated to 0 length
TruncateLen int /// If is true, The size of the file must be at least this size, /// in bytes, to truncate it ///
Результат System

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

Adds a message to the queue, to be written to the log file
public Write ( string message ) : void
message string The message to write to the log
Результат void

Описание свойств

LoggingEnabled публичное свойство

Gets or sets whether we having logging enabled. If disabled, all invokes to Write() will be ignored
public bool LoggingEnabled
Результат bool