diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-25 21:36:37 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-25 21:36:37 +0000 |
commit | e6d8d2dd8eff63c23f0ffad25c5e2529bde93485 (patch) | |
tree | cce9c591350ce1d29c67df3339c526b182e8763e /src/log.cpp | |
parent | 33e19fb0822308a630ca6e1122b9b97882a120a7 (diff) | |
download | mana-e6d8d2dd8eff63c23f0ffad25c5e2529bde93485.tar.gz mana-e6d8d2dd8eff63c23f0ffad25c5e2529bde93485.tar.bz2 mana-e6d8d2dd8eff63c23f0ffad25c5e2529bde93485.tar.xz mana-e6d8d2dd8eff63c23f0ffad25c5e2529bde93485.zip |
Added support for writing log to standard output.
Diffstat (limited to 'src/log.cpp')
-rw-r--r-- | src/log.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/log.cpp b/src/log.cpp index 3d101d29..07eb55f7 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -31,6 +31,10 @@ #include <iostream> #include <sstream> +Logger::Logger(): + mLogToStandardOut(false) +{ +} Logger::~Logger() { @@ -85,6 +89,11 @@ void Logger::log(const char *log_text, ...) mLogFile << timeStr.str() << buf << std::endl; + if (mLogToStandardOut) + { + std::cout << timeStr.str() << buf << std::endl; + } + // Delete temporary buffer delete[] buf; } |