Lean  $LEAN_TAG$
QuantConnect.Logging.FileLogHandler Class Reference

Provides an implementation of ILogHandler that writes all log messages to a file on disk. More...

Inheritance diagram for QuantConnect.Logging.FileLogHandler:
[legend]

Public Member Functions

 FileLogHandler (string filepath, bool useTimestampPrefix=true)
 Initializes a new instance of the FileLogHandler class to write messages to the specified file path. The file will be opened using FileMode.Append More...
 
 FileLogHandler ()
 Initializes a new instance of the FileLogHandler class using 'log.txt' for the filepath. More...
 
void Error (string text)
 Write error message to log More...
 
void Debug (string text)
 Write debug message to log More...
 
void Trace (string text)
 Write debug message to log More...
 
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 

Protected Member Functions

virtual string CreateMessage (string text, string level)
 Creates the message to be logged More...
 

Detailed Description

Provides an implementation of ILogHandler that writes all log messages to a file on disk.

Definition at line 25 of file FileLogHandler.cs.

Constructor & Destructor Documentation

◆ FileLogHandler() [1/2]

QuantConnect.Logging.FileLogHandler.FileLogHandler ( string  filepath,
bool  useTimestampPrefix = true 
)

Initializes a new instance of the FileLogHandler class to write messages to the specified file path. The file will be opened using FileMode.Append

Parameters
filepathThe file path use to save the log messages
useTimestampPrefixTrue to prefix each line in the log which the UTC timestamp, false otherwise

Definition at line 40 of file FileLogHandler.cs.

◆ FileLogHandler() [2/2]

QuantConnect.Logging.FileLogHandler.FileLogHandler ( )

Initializes a new instance of the FileLogHandler class using 'log.txt' for the filepath.

Definition at line 51 of file FileLogHandler.cs.

Member Function Documentation

◆ Error()

void QuantConnect.Logging.FileLogHandler.Error ( string  text)

Write error message to log

Parameters
textThe error text to log

Implements QuantConnect.Logging.ILogHandler.

Definition at line 60 of file FileLogHandler.cs.

◆ Debug()

void QuantConnect.Logging.FileLogHandler.Debug ( string  text)

Write debug message to log

Parameters
textThe debug text to log

Implements QuantConnect.Logging.ILogHandler.

Definition at line 69 of file FileLogHandler.cs.

◆ Trace()

void QuantConnect.Logging.FileLogHandler.Trace ( string  text)

Write debug message to log

Parameters
textThe trace text to log

Implements QuantConnect.Logging.ILogHandler.

Definition at line 78 of file FileLogHandler.cs.

◆ Dispose()

void QuantConnect.Logging.FileLogHandler.Dispose ( )

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

<filterpriority>2</filterpriority>

Definition at line 87 of file FileLogHandler.cs.

◆ CreateMessage()

virtual string QuantConnect.Logging.FileLogHandler.CreateMessage ( string  text,
string  level 
)
protectedvirtual

Creates the message to be logged

Parameters
textThe text to be logged
levelThe logging leel
Returns

Definition at line 105 of file FileLogHandler.cs.


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