forked from mirror/openmw-tes3mp
added prefix LOG_ to loglevel
This commit is contained in:
parent
170455e08a
commit
8d88381dac
4 changed files with 17 additions and 17 deletions
|
@ -58,13 +58,13 @@ void Log::print(int level, const char *file, int line, const char *message, ...)
|
|||
str += "[";
|
||||
switch(level)
|
||||
{
|
||||
case WARNING:
|
||||
case LOG_WARN:
|
||||
str += "WARN";
|
||||
break;
|
||||
case ERROR:
|
||||
case LOG_ERROR:
|
||||
str += "ERR";
|
||||
break;
|
||||
case FATAL:
|
||||
case LOG_FATAL:
|
||||
str += "FATAL";
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -22,10 +22,10 @@ class Log
|
|||
public:
|
||||
enum
|
||||
{
|
||||
INFO = 0,
|
||||
WARNING,
|
||||
ERROR,
|
||||
FATAL,
|
||||
LOG_INFO = 0,
|
||||
LOG_WARN,
|
||||
LOG_ERROR,
|
||||
LOG_FATAL,
|
||||
};
|
||||
static void Create(int logLevel);
|
||||
static void Delete();
|
||||
|
|
|
@ -93,18 +93,18 @@ RakNet::RakString MasterClient::Send(std::string motd, unsigned players, unsigne
|
|||
// then Receive(), then HasFailedConnectionAttempt(),HasLostConnection()
|
||||
sa = tcpInterface.HasCompletedConnectionAttempt();
|
||||
if (sa != RakNet::UNASSIGNED_SYSTEM_ADDRESS)
|
||||
LOG_MESSAGE_SIMPLE(Log::INFO, "Connected to master server: %s", sa.ToString());
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Connected to master server: %s", sa.ToString());
|
||||
|
||||
sa = tcpInterface.HasFailedConnectionAttempt();
|
||||
if (sa != RakNet::UNASSIGNED_SYSTEM_ADDRESS)
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::WARNING, "Failed to connect to master server: %s", sa.ToString());
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Failed to connect to master server: %s", sa.ToString());
|
||||
return "FAIL_CONNECT";
|
||||
}
|
||||
sa = tcpInterface.HasLostConnection();
|
||||
if (sa != RakNet::UNASSIGNED_SYSTEM_ADDRESS)
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::WARNING, "Lost connection to master server: %s", sa.ToString());
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Lost connection to master server: %s", sa.ToString());
|
||||
return "LOST_CONNECTION";
|
||||
}
|
||||
|
||||
|
@ -132,12 +132,12 @@ void MasterClient::Update()
|
|||
while (sRun)
|
||||
{
|
||||
if (response == "Created")
|
||||
LOG_MESSAGE_SIMPLE(Log::INFO, "Server registered on the master server.", "");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Server registered on the master server.", "");
|
||||
else if (response == "Accepted")
|
||||
LOG_MESSAGE_SIMPLE(Log::INFO, "Server updated information about himself on the master server.", "");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Server updated information about himself on the master server.", "");
|
||||
else if (response == "bad request")
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::WARNING, "Update rate is too low, and the master server has deleted information about"
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Update rate is too low, and the master server has deleted information about"
|
||||
" the server. Trying low rate...", "");
|
||||
SetUpdateRate(timeout - step_rate);
|
||||
update = false;
|
||||
|
|
|
@ -78,8 +78,8 @@ int main(int argc, char *argv[])
|
|||
loadSettings(mgr);
|
||||
|
||||
int logLevel = mgr.getInt("loglevel", "General");
|
||||
if(logLevel < Log::INFO || logLevel > Log::FATAL)
|
||||
logLevel = Log::INFO;
|
||||
if(logLevel < Log::LOG_INFO || logLevel > Log::LOG_FATAL)
|
||||
logLevel = Log::LOG_INFO;
|
||||
LOG_INIT(logLevel);
|
||||
|
||||
int players = mgr.getInt("players", "General");
|
||||
|
@ -120,7 +120,7 @@ int main(int argc, char *argv[])
|
|||
MasterClient *mclient;
|
||||
if(masterEnabled)
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::INFO, "%s", "Sharing server query info to master enabled.");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Sharing server query info to master enabled.");
|
||||
string masterAddr = mgr.getString("address", "MasterServer");
|
||||
int masterPort = mgr.getInt("port", "MasterServer");
|
||||
mclient = new MasterClient(masterAddr, (unsigned short) masterPort, addr, (unsigned short) port);
|
||||
|
@ -142,7 +142,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
if (code == 0)
|
||||
LOG_MESSAGE_SIMPLE(Log::INFO, "%s", "Quitting peacefully.");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Quitting peacefully.");
|
||||
|
||||
LOG_QUIT();
|
||||
return code;
|
||||
|
|
Loading…
Reference in a new issue