|
Lines 67-73
void
Link Here
|
| 67 |
internal_log_err(const string &msg) |
67 |
internal_log_err(const string &msg) |
| 68 |
{ |
68 |
{ |
| 69 |
if (!g_logFile.empty()) { |
69 |
if (!g_logFile.empty()) { |
| 70 |
ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app); |
70 |
std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app); |
| 71 |
if (!o.fail()) { |
71 |
if (!o.fail()) { |
| 72 |
o << second_clock::local_time() << " ERR: " << msg; |
72 |
o << second_clock::local_time() << " ERR: " << msg; |
| 73 |
o.flush(); |
73 |
o.flush(); |
|
Lines 80-86
internal_log_msg(const std::string &msg)
Link Here
|
| 80 |
{ |
80 |
{ |
| 81 |
if (g_logLevel) { |
81 |
if (g_logLevel) { |
| 82 |
if (!g_logFile.empty()) { |
82 |
if (!g_logFile.empty()) { |
| 83 |
ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app); |
83 |
std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app); |
| 84 |
if (!o.fail()) |
84 |
if (!o.fail()) |
| 85 |
o << second_clock::local_time() << " MSG: " << msg; |
85 |
o << second_clock::local_time() << " MSG: " << msg; |
| 86 |
} |
86 |
} |
|
Lines 92-98
internal_log_level(const std::string &msg, int logLevel)
Link Here
|
| 92 |
{ |
92 |
{ |
| 93 |
if (g_logLevel >= logLevel) { |
93 |
if (g_logLevel >= logLevel) { |
| 94 |
if (!g_logFile.empty()) { |
94 |
if (!g_logFile.empty()) { |
| 95 |
ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app); |
95 |
std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app); |
| 96 |
if (!o.fail()) |
96 |
if (!o.fail()) |
| 97 |
o << second_clock::local_time() << " OUT: " << msg; |
97 |
o << second_clock::local_time() << " OUT: " << msg; |
| 98 |
} |
98 |
} |