Public Member Functions | |
| virtual | ~QMsgLogger () |
| destructor | |
| bool | HasError () const |
| void | ResetError () |
| const QError & | GetError () const |
| bool | RegisterProcess (const std::string &process, const std::string &host, pid_t pid) |
| register process to message logger | |
| bool | ReleaseProcess (const std::string &process) |
| unregister previously registered process | |
| bool | UpdateStatus (const std::string &process, ProcessStatus_t status) |
| update process status informations | |
| void | WriteLog (MsgLevel severity, const std::string &sender, const std::string &message) |
| write message supplied by external processes | |
| void | Write (const std::string &message, MsgLevel severity) |
| write message not supplied by external processes) | |
| std::list< std::string > | GetRegisteredProcesses () const |
| get a vector containing names of registered processes | |
| bool | GetProcessInfo (const std::string &process, pid_t *pid, ProcessStatus_t *status, std::string *host) |
| get informations regarding a particular process | |
Static Public Member Functions | |
| static QMsgLogger & | GetInstance () |
| singleton | |
Private Member Functions | |
| QMsgLogger () | |
| private constructor | |
| const std::string & | GetTime () const |
| get current date and time formatted as a string | |
| const std::string & | FormatForLog (MsgLevel severity) const |
| translate a 'severity' string into a format suitable for log file | |
Private Attributes | |
| std::map< std::string, QProcessInfo_t * > | fProcesses |
| map of registered processes and corresponding informations | |
| std::ofstream | fOs |
| QError | fError |
Classes | |
| struct | QProcessInfo_t |
| bool QMsgLogger::RegisterProcess | ( | const std::string & | process, | |
| const std::string & | host, | |||
| pid_t | pid | |||
| ) |
register process to message logger
| process | process name | |
| host | process host | |
| pid | process pid |
| bool QMsgLogger::ReleaseProcess | ( | const std::string & | process | ) |
unregister previously registered process
| process | process name |
| bool QMsgLogger::UpdateStatus | ( | const std::string & | process, | |
| ProcessStatus_t | status | |||
| ) |
update process status informations
| process | process name | |
| status | new process status |
| void QMsgLogger::WriteLog | ( | MsgLevel | severity, | |
| const std::string & | sender, | |||
| const std::string & | message | |||
| ) |
write message supplied by external processes
| severity | message severity | |
| sender | sender process | |
| message | text message |
| void QMsgLogger::Write | ( | const std::string & | message, | |
| MsgLevel | severity | |||
| ) |
write message not supplied by external processes)
| message | text message | |
| severity | message severity |
| std::list< std::string > QMsgLogger::GetRegisteredProcesses | ( | ) | const |
get a vector containing names of registered processes
| bool QMsgLogger::GetProcessInfo | ( | const std::string & | process, | |
| pid_t * | pid, | |||
| ProcessStatus_t * | status, | |||
| std::string * | host | |||
| ) |
get informations regarding a particular process
Memory pointed by pid and status are filled with the corresponding informations. Pass NULL pointer to the quantities you are not interested in.
| process | the name of the wanted process | |
| pid | pointer to a variable that will be filled with Process Id | |
| status | pointer to a variable that will be filled with process status | |
| status | pointer to a variable that will be filled with the hostname of the requested process |
| const std::string & QMsgLogger::GetTime | ( | ) | const [private] |
get current date and time formatted as a string
| const std::string & QMsgLogger::FormatForLog | ( | MsgLevel | severity | ) | const [private] |
translate a 'severity' string into a format suitable for log file
| severity | string to be formatted |
1.5.1