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
파일 보기 프로젝트 열기: BF2Statistics/ControlCenter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
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