Write logging information either to a file or to stdout if no output file has been specified.
More...
#include <debugUtils.h>
|
| | LogFile () |
| | Create a logger that writes to stdout.
|
| |
| | LogFile (const std::string &filename) |
| | Create a logger that writes to the file named filename.
|
| |
| | ~LogFile () |
| |
| void | open (const std::string &filename) |
| | Direct any further output to the file named filename.
|
| |
| void | close () |
| | Close the current log file, directing any further output to stdout.
|
| |
| template<class T> |
| void | write (const T &other, bool newline=true) |
| | Write the value of other to the current log destination.
|
| |
| template<class T> |
| void | verboseWrite (const T &message, bool newline=true) |
| | Write the value of message to the current log destination only if the flag debugParameters::veryVerbose is set.
|
| |
Write logging information either to a file or to stdout if no output file has been specified.
Usually accessed through the global instance logFile.
◆ LogFile() [1/2]
Create a logger that writes to stdout.
◆ LogFile() [2/2]
| LogFile::LogFile |
( |
const std::string & | filename | ) |
|
|
explicit |
Create a logger that writes to the file named filename.
An existing file with the same name will be replaced.
◆ ~LogFile()
◆ open()
| void LogFile::open |
( |
const std::string & | filename | ) |
|
Direct any further output to the file named filename.
◆ close()
Close the current log file, directing any further output to stdout.
◆ write()
template<class T>
| void LogFile::write |
( |
const T & | other, |
|
|
bool | newline = true ) |
|
inline |
Write the value of other to the current log destination.
Templated so that any object that overloads operator<< for std::ostream will be appropriately formatted.
◆ verboseWrite()
template<class T>
| void LogFile::verboseWrite |
( |
const T & | message, |
|
|
bool | newline = true ) |
|
inline |
◆ haveFile
◆ file
| std::ofstream LogFile::file |
|
private |
The documentation for this class was generated from the following files: