diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-03-23 20:02:37 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-03-23 20:02:37 +0000 |
commit | 255da423d061e6f0ee3db009a7ed2c1ec8e60315 (patch) | |
tree | e46230d0ae8a4f61eb35d6bd13e2c5ec0b3bc692 /src/log.h | |
parent | 58ffdbff028f763451f471639c6aecc530ca4d94 (diff) | |
download | mana-255da423d061e6f0ee3db009a7ed2c1ec8e60315.tar.gz mana-255da423d061e6f0ee3db009a7ed2c1ec8e60315.tar.bz2 mana-255da423d061e6f0ee3db009a7ed2c1ec8e60315.tar.xz mana-255da423d061e6f0ee3db009a7ed2c1ec8e60315.zip |
New log class implementation Part 1/2
Diffstat (limited to 'src/log.h')
-rw-r--r-- | src/log.h | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -27,6 +27,45 @@ #include <stdarg.h> #include <time.h> #include <string> +#include <iostream> +#include <fstream> + +/** + * The Log Class : Useful to write debug or info messages + */ +class Logger +{ +public: + +/** + * Constructor : + * Initializes log file by opening it for writing. + */ +Logger(std::string logFilename); + +/** + * Destructor + */ +~Logger(); + +/** + * Enters a message in the log. The message will be timestamped. + */ +void log(std::string log_text); +void log(const char *log_text, ...); + +/** + * Log an error and quit. The error will pop-up in Windows and will be printed + * to standard error everywhere else. + */ +void error(const std::string &error_text); + +private: + +std::ofstream logFile; + +}; + /** * Initializes log file by opening it for writing. |