2 using System.Runtime.CompilerServices;
13 private Thread workerThread;
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();
36 public void LogException(
Exception exception, [CallerMemberName]
string memberName =
"", [CallerFilePath]
string filePath =
"", [CallerLineNumber]
int lineNumber = 0)
48 public void LogWarning(
string message, [CallerMemberName]
string memberName =
"", [CallerFilePath]
string filePath =
"", [CallerLineNumber]
int lineNumber = 0)
60 public void LogInfo(
string message, [CallerMemberName]
string memberName =
"", [CallerFilePath]
string filePath =
"", [CallerLineNumber]
int lineNumber = 0)
70 this.CloseLoggerTask();
73 private void CloseLoggerTask()
75 this.loggerTask.
Stop();
Severity
Severity of a log event
void EnqueueObject(LoggerInfo loggerInfo)
Enqueues the object.
Class for holding log information
void LogWarning(string message, [CallerMemberName] string memberName="", [CallerFilePath] string filePath="", [CallerLineNumber] int lineNumber=0)
Logs the warning.
void StartLogging(string folder, string fileName)
Starts the logging.
Class holfing a logger thread
void Stop()
Stops this instance.
bool IsStopped
Gets a value indicating whether this instance is stopped.
void DoWork()
Does the work. Events to log are filled in a concurrent queue and then read here in serial order...
void LogInfo(string message, [CallerMemberName] string memberName="", [CallerFilePath] string filePath="", [CallerLineNumber] int lineNumber=0)
Logs the information.
void Dispose()
Releases unmanaged and - optionally - managed resources.
void LogException(Exception exception, [CallerMemberName] string memberName="", [CallerFilePath] string filePath="", [CallerLineNumber] int lineNumber=0)
Logs the exception.