Move server configuration to dedicated server only. Separate error logging for client and server, in preparation of creating a log file on the dedicated server.

This commit is contained in:
lotodore
2007-11-22 00:57:03 +00:00
parent e28220a8ad
commit c5bae66142
10 changed files with 230 additions and 41 deletions
+21 -30
View File
@@ -21,37 +21,28 @@
#ifndef _LOGHELPER_H_
#define _LOGHELPER_H_
#ifndef _WIN32
#ifdef POKERTH_DEDICATED_SERVER
#include <sstream>
#include <syslog.h>
#include <stdarg.h>
#define LOG_ERROR(e) \
do \
{ \
std::ostringstream outStream; \
outStream << e << std::endl; \
syslog(LOG_ERR, "%s", outStream.str().c_str()); \
} \
while(false)
#define LOG_MSG(e) \
do \
{ \
std::ostringstream outStream; \
outStream << e << std::endl; \
syslog(LOG_INFO, "%s", outStream.str().c_str()); \
} \
while(false)
#endif
#endif
#include <string>
#include <sstream>
#ifndef LOG_ERROR
#include <iostream>
#define LOG_ERROR(e) \
std::cout << e << std::endl
#define LOG_MSG(e) \
std::cout << e << std::endl
#endif
void internal_log_err(const std::string &msg);
void internal_log_msg(const std::string &msg);
#define LOG_ERROR(e) \
do \
{ \
std::ostringstream outStream; \
outStream << e << std::endl; \
internal_log_err(outStream.str()); \
} \
while(false)
#define LOG_MSG(e) \
do \
{ \
std::ostringstream outStream; \
outStream << e << std::endl; \
internal_log_msg(outStream.str()); \
} \
while(false)
#endif