#include <logfile.h>
Public Member Functions | |
LogFile (string, mode_t=0640) | |
~LogFile () | |
string | class_name (void) |
std::string | get_id (void) const |
Instance identification string (abstract virtual). | |
Private Member Functions | |
void | connect (void) |
void | disconnect (void) |
Write a message to the log file, then close it. | |
Private Attributes | |
string | path |
mode_t | mode |
Used to log all incoming data from a connected server to a file for later review.
Consider renaming to FileConnector, since it could be used for files other than logfiles. But then, we log things when we open and close the file, so perhaps it really is just for logfiles.
Definition at line 62 of file logfile.h.
LogFile::LogFile | ( | string | fn, | |
mode_t | m = 0640 | |||
) |
Definition at line 50 of file logfile.cc.
References connect().
LogFile::~LogFile | ( | ) | [inline] |
Definition at line 65 of file logfile.h.
References disconnect().
string LogFile::get_id | ( | void | ) | const [virtual] |
Instance identification string (abstract virtual).
Reimplemented from FDConnector.
Definition at line 59 of file logfile.cc.
References path.
void LogFile::connect | ( | void | ) | [private] |
Definition at line 71 of file logfile.cc.
References __progname, FDConnector::connect(), FDConnector::fd, mode, path, and FDConnector::write().
Referenced by LogFile().
void LogFile::disconnect | ( | void | ) | [private, virtual] |
Write a message to the log file, then close it.
Reimplemented from FDConnector.
Definition at line 110 of file logfile.cc.
References FDConnector::connected(), and FDConnector::write().
Referenced by ~LogFile().
string LogFile::path [private] |
mode_t LogFile::mode [private] |