Renamed LogSeverity Symbols, like.. LogSeveritySuccess from Succuess to avoid conflicts with macros such as those in X11 header.

This commit is contained in:
Syphurith 2015-05-22 20:16:30 +08:00
parent 2a7c65c019
commit 5a6869fc5e
3 changed files with 24 additions and 24 deletions

View File

@ -57,7 +57,7 @@ LogChannel::LogChannel() : LogChannel("unknown")
LogChannel::LogChannel(const std::string& name) :
name(name)
, mEnabled(true)
, mLogLevel(Warning)
, mLogLevel(LogSeverityWarning)
{}
void LogChannel::log(const LogMessage &msg)
@ -186,16 +186,16 @@ void LogManager::log(LogMessage msg)
std::string prefix;
switch (msg.mServerity)
{
case Success:
case LogSeveritySuccess:
prefix = "S ";
break;
case Notice:
case LogSeverityNotice:
prefix = "! ";
break;
case Warning:
case LogSeverityWarning:
prefix = "W ";
break;
case Error:
case LogSeverityError:
prefix = "E ";
break;
}
@ -265,12 +265,12 @@ void log_message(Log::LogType type, Log::LogSeverity sev, std::string text)
else
{
rMessageBox(text,
sev == Notice ? "Notice" :
sev == Warning ? "Warning" :
sev == Success ? "Success" :
sev == Error ? "Error" : "Unknown",
sev == Notice ? rICON_INFORMATION :
sev == Warning ? rICON_EXCLAMATION :
sev == Error ? rICON_ERROR : rICON_INFORMATION);
sev == LogSeverityNotice ? "Notice" :
sev == LogSeverityWarning ? "Warning" :
sev == LogSeveritySuccess ? "Success" :
sev == LogSeverityError ? "Error" : "Unknown",
sev == LogSeverityNotice ? rICON_INFORMATION :
sev == LogSeverityWarning ? rICON_EXCLAMATION :
sev == LogSeverityError ? rICON_ERROR : rICON_INFORMATION);
}
}

View File

@ -5,10 +5,10 @@
//first parameter is of type Log::LogType and text is of type std::string
#define LOG_SUCCESS(logType, text, ...) log_message(logType, Log::Success, text, ##__VA_ARGS__)
#define LOG_NOTICE(logType, text, ...) log_message(logType, Log::Notice, text, ##__VA_ARGS__)
#define LOG_WARNING(logType, text, ...) log_message(logType, Log::Warning, text, ##__VA_ARGS__)
#define LOG_ERROR(logType, text, ...) log_message(logType, Log::Error, text, ##__VA_ARGS__)
#define LOG_SUCCESS(logType, text, ...) log_message(logType, Log::LogSeveritySuccess, text, ##__VA_ARGS__)
#define LOG_NOTICE(logType, text, ...) log_message(logType, Log::LogSeverityNotice, text, ##__VA_ARGS__)
#define LOG_WARNING(logType, text, ...) log_message(logType, Log::LogSeverityWarning, text, ##__VA_ARGS__)
#define LOG_ERROR(logType, text, ...) log_message(logType, Log::LogSeverityError, text, ##__VA_ARGS__)
namespace Log
{
@ -50,10 +50,10 @@ namespace Log
enum LogSeverity : u32
{
Notice = 0,
Warning,
Success,
Error,
LogSeverityNotice = 0,
LogSeverityWarning,
LogSeveritySuccess,
LogSeverityError,
};
struct LogMessage

View File

@ -76,16 +76,16 @@ struct wxWriter : Log::LogListener
{
switch (msg.mServerity)
{
case Log::Notice:
case Log::LogSeverityNotice:
llogcon->SetDefaultStyle(m_color_white);
break;
case Log::Warning:
case Log::LogSeverityWarning:
llogcon->SetDefaultStyle(m_color_yellow);
break;
case Log::Error:
case Log::LogSeverityError:
llogcon->SetDefaultStyle(m_color_red);
break;
case Log::Success:
case Log::LogSeveritySuccess:
llogcon->SetDefaultStyle(m_color_green);
break;
default: