x4Trace Documentation v1.0
Loading...
Searching...
No Matches
Tools.LOG Class Reference

Represents a logger object. More...

Public Member Functions

 LOG (string path, string fileName)
 Constructor.
 
 LOG (string path, string fileName, bool isEnabled, bool enforceWriteline)
 Constructor.
 
void Start ()
 Starts the logging.
 
void Stop ()
 Stops the logging.
 
void Error (string text)
 Logs an error message.
 
void Warning (string text)
 Logs a warning message.
 
void Write (string text)
 Logs a message.
 
void Write (Exception ex)
 Logs an exception.
 

Static Public Member Functions

static void OnLogProcessed (LOG log, string text)
 Fires log processed message.
 

Properties

bool IsEnabled [get, set]
 Is the logging enabled.
 

Events

static LogProcessed sLogProcessed
 Static event of log processed.
 
LogProcessed LogProcessed
 Event of log processed.
 

Private Member Functions

void Dispatcher_Processed (object obj)
 Runs when the dispatcher fires a process event. Processes a log message. Writes to file.
 

Private Attributes

Dispatch.Dispatcher dispatcher
 The dispatcher for process log events.
 
string path = ""
 Path of file.
 
string fileName = ""
 Name of the file.
 
DateTime latestLog = new DateTime(1900, 1, 1)
 Date time of the latest log.
 
System.IO.TextWriter tw
 Text writer of logs.
 
bool isEnabled = false
 Is the logging enabled.
 
bool enforceWriteline = false
 When true the log message is writes to console.
 

Detailed Description

Represents a logger object.

Constructor & Destructor Documentation

◆ LOG() [1/2]

Tools.LOG.LOG ( string path,
string fileName )

Constructor.

Parameters
pathThe path of file.
fileNameThe name of file.

◆ LOG() [2/2]

Tools.LOG.LOG ( string path,
string fileName,
bool isEnabled,
bool enforceWriteline )

Constructor.

Parameters
pathThe path of file.
fileNameThe name of file.
isEnabledIs the logging enabled.
enforceWritelineWhen true the log message is writes to console.

Member Function Documentation

◆ Dispatcher_Processed()

void Tools.LOG.Dispatcher_Processed ( object obj)
private

Runs when the dispatcher fires a process event. Processes a log message. Writes to file.

Parameters
objText of log message.

◆ Error()

void Tools.LOG.Error ( string text)

Logs an error message.

Parameters
text

◆ OnLogProcessed()

static void Tools.LOG.OnLogProcessed ( LOG log,
string text )
static

Fires log processed message.

Parameters
logObject of logger.
textText of log.

◆ Warning()

void Tools.LOG.Warning ( string text)

Logs a warning message.

Parameters
text

◆ Write() [1/2]

void Tools.LOG.Write ( Exception ex)

Logs an exception.

Parameters
ex

◆ Write() [2/2]

void Tools.LOG.Write ( string text)

Logs a message.

Parameters
text

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