More verbose logging for the server.

This commit is contained in:
lotodore
2008-03-19 23:39:59 +00:00
parent 0575d1eb1c
commit c8b38d0e57
6 changed files with 88 additions and 11 deletions
+15 -3
View File
@@ -27,21 +27,33 @@
using namespace std;
static int g_logLevel = 1;
void
loghelper_init(const std::string & /*logDir*/)
loghelper_init(const std::string & /*logDir*/, int logLevel)
{
// Do not log to file as client.
g_logLevel = logLevel;
}
void
internal_log_err(const string &msg)
{
cout << msg;
cerr << msg;
}
void
internal_log_msg(const std::string &msg)
{
cout << msg;
if (g_logLevel)
cout << msg;
}
void
internal_log_level(const std::string &msg, int logLevel)
{
if (g_logLevel >= logLevel)
cout << msg;
}