From 31459efbd3e63433b11fbf1005b3aa116d9bc3c1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 18 Sep 2017 19:35:50 +0300 Subject: Redirect logging to file after log file opened. If log file open failed, redirect logging back to stdout. --- src/logger.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/logger.cpp') 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; } } -- cgit v1.2.3-70-g09d2