#include <log.h>
Public Methods | |
| Log (string &r_fname) | |
| Log (const char *fname) | |
| ~Log () | |
| void | Write (const string &r_msg) |
| void | Write (const char *fmt,...) |
| void | SetActive (bool b) |
| bool | IsActive () |
Private Methods | |
| Log (Log &) | |
| Log & | operator= (Log &) |
| void | SetTime () |
Private Attributes | |
| string | mFileName |
| log's filename or empty if cout (console) | |
| ofstream * | mpFile |
| file stream or null if cout (console) | |
| bool | mActive |
| flag indicating if logging is on or off | |
| char | mTimeStamp [40] |
current timestamp formatted
| |
| CRITICAL_SECTION | mMutex |
| To enforce mutual exclusion. | |
Definition at line 30 of file log.h.
|
|
Constructor for Log.
|
|
|
Constructor for Log.
|
|
|
Log destructor. |
|
|
|
|
|
IsActive queries the whether logging is on or off.
|
|
|
|
|
|
SetActive turns logging on or off.
|
|
|
SetTime refreshes the log timestamp with the current time.
Definition at line 77 of file log.cpp. References mTimeStamp. Referenced by Write(). |
|
||||||||||||
|
Write a formatted message to the log.
Definition at line 115 of file log.cpp. References mMutex, mpFile, mTimeStamp, and SetTime(). |
|
|
Write a string message to the log.
Definition at line 89 of file log.cpp. References mMutex, mpFile, mTimeStamp, and SetTime(). Referenced by Server::AcceptConnection(), Server::Boot(), Connection::Disconnect(), Connection::HandleInput(), Connection::HandleOutput(), main(), Server::Run(), Server::SetNonBlocking(), and Server::ShutdownServer(). |
|
|
flag indicating if logging is on or off
|
|
|
log's filename or empty if cout (console)
Definition at line 44 of file log.h. Referenced by Log(). |
|
|
To enforce mutual exclusion.
Definition at line 48 of file log.h. Referenced by IsActive(), Log(), SetActive(), Write(), and ~Log(). |
|
|
file stream or null if cout (console)
|
|
|
current timestamp formatted
|
1.2.17