diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-09-18 19:35:50 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-09-18 19:35:50 +0300 |
commit | 31459efbd3e63433b11fbf1005b3aa116d9bc3c1 (patch) | |
tree | 052204ada4255cb4f43267f933a2afae1478efd3 /src/logger.cpp | |
parent | e7537ca6033a13ff1d21aac4a61a49ef325684b6 (diff) | |
download | plus-31459efbd3e63433b11fbf1005b3aa116d9bc3c1.tar.gz plus-31459efbd3e63433b11fbf1005b3aa116d9bc3c1.tar.bz2 plus-31459efbd3e63433b11fbf1005b3aa116d9bc3c1.tar.xz plus-31459efbd3e63433b11fbf1005b3aa116d9bc3c1.zip |
Redirect logging to file after log file opened.
If log file open failed, redirect logging back to stdout.
Diffstat (limited to 'src/logger.cpp')
-rw-r--r-- | src/logger.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/logger.cpp b/src/logger.cpp index 8582d0b4b..c8317f808 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -126,6 +126,11 @@ void Logger::setLogFile(const std::string &logFilename) { std::cout << "Warning: error while opening " << logFilename << " for writing.\n"; + mLogToStandardOut = true; + } + else + { + mLogToStandardOut = false; } } |