Simply3DScan
Logging.Logger Class Reference

Class holfing a logger thread More...

Public Member Functions

void StartLogging (string folder, string fileName)
 Starts the logging. More...
 
void LogException (Exception exception, [CallerMemberName] string memberName="", [CallerFilePath] string filePath="", [CallerLineNumber] int lineNumber=0)
 Logs the exception. More...
 
void LogWarning (string message, [CallerMemberName] string memberName="", [CallerFilePath] string filePath="", [CallerLineNumber] int lineNumber=0)
 Logs the warning. More...
 
void LogInfo (string message, [CallerMemberName] string memberName="", [CallerFilePath] string filePath="", [CallerLineNumber] int lineNumber=0)
 Logs the information. More...
 
void Dispose ()
 Releases unmanaged and - optionally - managed resources. More...
 

Detailed Description

Class holfing a logger thread

Definition at line 10 of file Logger.cs.

Member Function Documentation

void Logging.Logger.Dispose ( )

Releases unmanaged and - optionally - managed resources.

Definition at line 68 of file Logger.cs.

69  {
70  this.CloseLoggerTask();
71  }
void Logging.Logger.LogException ( Exception  exception,
[CallerMemberName] string  memberName = "",
[CallerFilePath] string  filePath = "",
[CallerLineNumber] int  lineNumber = 0 
)

Logs the exception.

Parameters
exceptionThe exception.
memberNameName of the member.
filePathThe file path.
lineNumberThe line number.

Definition at line 36 of file Logger.cs.

37  {
38  this.loggerTask?.EnqueueObject(new LoggerInfo(DateTime.Now, Severity.Exception, exception + exception.StackTrace, memberName, filePath, lineNumber));
39  }
Severity
Severity of a log event
Definition: Severity.cs:6
void EnqueueObject(LoggerInfo loggerInfo)
Enqueues the object.
Definition: LoggerTask.cs:80

Here is the call graph for this function:

void Logging.Logger.LogInfo ( string  message,
[CallerMemberName] string  memberName = "",
[CallerFilePath] string  filePath = "",
[CallerLineNumber] int  lineNumber = 0 
)

Logs the information.

Parameters
messageThe message.
memberNameName of the member.
filePathThe file path.
lineNumberThe line number.

Definition at line 60 of file Logger.cs.

61  {
62  this.loggerTask?.EnqueueObject(new LoggerInfo(DateTime.Now, Severity.Info, message, memberName, filePath, lineNumber));
63  }
Severity
Severity of a log event
Definition: Severity.cs:6
void EnqueueObject(LoggerInfo loggerInfo)
Enqueues the object.
Definition: LoggerTask.cs:80

Here is the call graph for this function:

void Logging.Logger.LogWarning ( string  message,
[CallerMemberName] string  memberName = "",
[CallerFilePath] string  filePath = "",
[CallerLineNumber] int  lineNumber = 0 
)

Logs the warning.

Parameters
messageThe message.
memberNameName of the member.
filePathThe file path.
lineNumberThe line number.

Definition at line 48 of file Logger.cs.

49  {
50  this.loggerTask?.EnqueueObject(new LoggerInfo(DateTime.Now, Severity.Warning, message, memberName, filePath, lineNumber));
51  }
Severity
Severity of a log event
Definition: Severity.cs:6
void EnqueueObject(LoggerInfo loggerInfo)
Enqueues the object.
Definition: LoggerTask.cs:80

Here is the call graph for this function:

void Logging.Logger.StartLogging ( string  folder,
string  fileName 
)

Starts the logging.

Parameters
folderThe folder.
fileNameName of the file.

Definition at line 20 of file Logger.cs.

21  {
22  if (this.loggerTask != null)
23  this.CloseLoggerTask();
24  this.loggerTask = new LoggerTask(folder, fileName);
25  this.workerThread = new Thread(this.loggerTask.DoWork) {IsBackground = true};
26  this.workerThread.Start();
27  }
void DoWork()
Does the work. Events to log are filled in a concurrent queue and then read here in serial order...
Definition: LoggerTask.cs:43

Here is the call graph for this function:


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