Writes output of the system command ps to a logfile. More...
#include <pslogger.hh>

Public Member Functions | |
| void | log (std::string logMessage) |
| writes the log message and the output of ps to the logfile. | |
| PsLogger (std::string fileName, std::string format="rss pcpu") | |
| Constructor. | |
Private Attributes | |
| std::string | command_ |
| std::string | fileName_ |
Writes output of the system command ps to a logfile.
Definition at line 9 of file pslogger.hh.
| PsLogger::PsLogger | ( | std::string | fileName, |
| std::string | format = "rss pcpu" |
||
| ) |
Constructor.
| fileName | name of the logfile |
| format | the format of the output of ps. By default, memory consumption (rss) and cpu load (pcpu) are logged. See man ps for more information about format specifiers. |
| void PsLogger::log | ( | std::string | logMessage | ) |
writes the log message and the output of ps to the logfile.
| logMessage | the log message to write into the logfile |
std::string PsLogger::command_ [private] |
Definition at line 24 of file pslogger.hh.
std::string PsLogger::fileName_ [private] |
Definition at line 23 of file pslogger.hh.