C# Class ControlSystem.DatabaseLogger

Logs events to the database.
Inheritance: ILogger
Mostra file Open project: syre/SortingIndustrialRobot Class Usage Examples

Private Properties

Property Type Description
LogThreadFunction void
addItemToQueue void
createLog void

Public Methods

Method Description
DatabaseLogger ( string _threadName = "LogThread" ) : System

Default constructor.

log ( string _sMsg, eLogType _eltType ) : void

Main function to be called when logging to database is needed.

prepForShutdownApp ( ) : void

Makes the log thread finish up and stop, making sure all logs have been sent to database

Private Methods

Method Description
LogThreadFunction ( ) : void

Function which will be running in its own thread, continuesly adding logs to database

addItemToQueue ( Tuple _tubLog ) : void

Function which adds a tuple to the queue, but at the same time sends event to log thread that another has been added

createLog ( string _sLog, string _sMsg, System.DateTime _dTime ) : void

Private helping function to utilize database connection, query and execution

Method Details

DatabaseLogger() public method

Default constructor.
public DatabaseLogger ( string _threadName = "LogThread" ) : System
_threadName string
return System

log() public method

Main function to be called when logging to database is needed.
public log ( string _sMsg, eLogType _eltType ) : void
_sMsg string
_eltType eLogType Type of log
return void

prepForShutdownApp() public method

Makes the log thread finish up and stop, making sure all logs have been sent to database
public prepForShutdownApp ( ) : void
return void