![]() |
Menge
Modular Pedestrian Simulation Framework for Research and Development
|
An html logger - writes messages to a formatted html file. More...
#include <Logger.h>
Public Types | |
| enum | LogType { UNDEF_LOG, INFO_MSG, WARN_MSG, ERR_MSG } |
| Classfies interpretation of the subsequent streaming elements. More... | |
Public Member Functions | |
| MENGE_API | Logger () |
| Default constructor. | |
| MENGE_API | ~Logger () |
| Destructor. | |
| MENGE_API void | close () |
| Closes the logger down. | |
| MENGE_API void | line () |
| Writes a solid line to the logger. | |
| MENGE_API void | setFile (const std::string &fileName) |
| Sets the logger's output file. More... | |
Protected Member Functions | |
| void | writeHeader () |
| Writes the html header information to the given file. | |
| void | writeTail () |
| Writes the html tail information to the given file. | |
| void | processText (std::string &input) |
| Process text. More... | |
Protected Attributes | |
| bool | _validFile |
| Indicates if the output file is valid. | |
| std::ofstream | _file |
| The file object for the html to be written to. | |
| LogType | _streamType |
| The current message type. | |
Friends | |
| MENGE_API Logger & | operator<< (Logger &logger, const std::string &msg) |
| Writes strings to the logger based on current status. More... | |
| MENGE_API Logger & | operator<< (Logger &logger, const char *msg) |
| Writes strings to the logger based on current status. More... | |
| MENGE_API Logger & | operator<< (Logger &logger, long unsigned int value) |
| Writes long unsigned int to the logger based on current status. More... | |
| MENGE_API Logger & | operator<< (Logger &logger, unsigned int value) |
| Writes long unsigned int to the logger based on current status. More... | |
| MENGE_API Logger & | operator<< (Logger &logger, int value) |
| Writes int to the logger based on current status. More... | |
| MENGE_API Logger & | operator<< (Logger &logger, float value) |
| Writes float to the logger based on current status. More... | |
| MENGE_API Logger & | operator<< (Logger &logger, double value) |
| Writes double to the logger based on current status. More... | |
| MENGE_API Logger & | operator<< (Logger &logger, Logger::LogType type) |
| Changes the message status of the logger. More... | |
An html logger - writes messages to a formatted html file.
|
protected |
Process text.
Modifies the string in place to make an html version of the text if the output file is valid, otherwise, simply returns leaving the string untouched.
| input | The input text to write to the log. The string |
| void Menge::Logger::setFile | ( | const std::string & | fileName | ) |
Sets the logger's output file.
If there is an error in opening the file, the logger will default to writing to the console.
| fileName | The file name to write the html to. |
Writes strings to the logger based on current status.
| logger | A reference to a logger. |
| msg | The string to write. |
Writes strings to the logger based on current status.
| logger | A reference to a logger. |
| msg | The string to write. |
Writes long unsigned int to the logger based on current status.
| logger | A reference to a logger. |
| value | The value to write. |
Writes long unsigned int to the logger based on current status.
| logger | A reference to a logger. |
| value | The value to write. |
Writes int to the logger based on current status.
| logger | A reference to a logger. |
| value | The value to write. |
Writes float to the logger based on current status.
| logger | A reference to a logger. |
| value | The value to write. |
Writes double to the logger based on current status.
| logger | A reference to a logger. |
| value | The value to write. |
|
friend |
Changes the message status of the logger.
| logger | A reference to a logger. |
| type | The value to write. |
1.8.8