We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40cfda9 commit 5d87a7bCopy full SHA for 5d87a7b
unix.cpp
@@ -19,6 +19,7 @@
19
#include <fstream>
20
21
static boost::mutex s_loggerLock;
22
+bool printFileErrorMsg = true;
23
24
using namespace std;
25
@@ -51,8 +52,14 @@ void LogMessage(const std::string &msg, const int &level)
51
52
out.open((const char *)log_file.c_str(), ios::out | ios::app);
53
if (!out.is_open())
54
{
- fprintf(stderr, "Can not open the logfile!");
55
+ if (printFileErrorMsg)
56
+ {
57
+ fprintf(stderr, "Can not open the logfile '%s'", log_file.c_str());
58
+ printFileErrorMsg = false;
59
+ }
60
return;
61
+ } else {
62
+ printFileErrorMsg = true;
63
}
64
65
else
0 commit comments