diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-19 13:46:58 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-19 13:46:58 +0000 |
commit | 06f587714bfef58adc608f72662bf5ea2df00ee8 (patch) | |
tree | a69a2f0411def5fb90b21e4daa689b5ee1ee0c5c /src/log.cpp | |
parent | 44cf0fd601f9f3f0bb51871dfe7b5645090f41e0 (diff) | |
download | mana-06f587714bfef58adc608f72662bf5ea2df00ee8.tar.gz mana-06f587714bfef58adc608f72662bf5ea2df00ee8.tar.bz2 mana-06f587714bfef58adc608f72662bf5ea2df00ee8.tar.xz mana-06f587714bfef58adc608f72662bf5ea2df00ee8.zip |
Added support for parsing command line options. Added option to skip the update process. Made the logger being created immediately after start, because some destructors use it.
Diffstat (limited to 'src/log.cpp')
-rw-r--r-- | src/log.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/log.cpp b/src/log.cpp index 07c12516..3222c856 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -29,22 +29,22 @@ #include <sstream> -Logger::Logger(const std::string &logFilename) +Logger::~Logger() { - logFile.open(logFilename.c_str(), std::ios_base::trunc); - - if (!logFile.is_open()) + if (logFile.is_open()) { - std::cout << "Warning: error while opening " << logFilename << - " for writing.\n"; + logFile.close(); } } -Logger::~Logger() +void Logger::setLogFile(const std::string &logFilename) { - if (logFile.is_open()) + logFile.open(logFilename.c_str(), std::ios_base::trunc); + + if (!logFile.is_open()) { - logFile.close(); + std::cout << "Warning: error while opening " << logFilename << + " for writing.\n"; } } |