Helper class to write to a log file.
More...
#include <logfile.h>
|
bool | open (const std::string &fileName) |
| Opens the specified file for writing. More...
|
|
std::string | getFileName () const |
| Returns the filename from the 'open' call. More...
|
|
void | print (const char *format,...) |
| Writes the specified parameters (similar to printf) to the logfile, automatically appending a newline character (\n). More...
|
|
void | printNoNewLine (const char *format,...) |
| Writes the specified parameters (similar to printf) to the logfile. More...
|
|
void | close () |
| Finalizes and closes the log file. More...
|
|
| ErrorBase () |
| Creates an instance without an explicit object name. More...
|
|
| ErrorBase (const std::string &objName) |
| Creates an instance with the object name set to objName . More...
|
|
std::string | getObjectName () const |
| Returns the stored object name. More...
|
|
std::string | getErrorString () const |
| Returns the currently stored error message. More...
|
|
|
static void | writeToAllLogFiles (const std::string &str) |
| Method to write something to all currently open log files, useful when program aborts and a message should appear in all logs. More...
|
|
|
void | setErrorString (const std::string &str) const |
| Derived classes can use this member function to store an error message. More...
|
|
Helper class to write to a log file.
Finalizes and closes the log file.
std::string LogFile::getFileName |
( |
| ) |
const |
|
inline |
Returns the filename from the 'open' call.
bool LogFile::open |
( |
const std::string & |
fileName | ) |
|
Opens the specified file for writing.
void LogFile::print |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Writes the specified parameters (similar to printf) to the logfile, automatically appending a newline character (\n).
void LogFile::printNoNewLine |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Writes the specified parameters (similar to printf) to the logfile.
void LogFile::writeToAllLogFiles |
( |
const std::string & |
str | ) |
|
|
static |
Method to write something to all currently open log files, useful when program aborts and a message should appear in all logs.
The documentation for this class was generated from the following files:
- src/lib/util/logfile.h
- src/lib/util/logfile.cpp