Misc: CRLF to LF, whitespace cleanup and tabs to spaces

This commit is contained in:
Nay
2012-08-15 21:30:55 +01:00
parent 52a5991c12
commit ca2bc35713
5 changed files with 2929 additions and 2929 deletions

View File

@@ -23,7 +23,7 @@ For example, sLog->outInfo(...) is a logging request of level INFO.
A logging request is said to be enabled if its level is higher than or equal to
the level of its logger. Otherwise, the request is said to be disabled. A logger
without an assigned level will inherit one from the hierarchy
without an assigned level will inherit one from the hierarchy
Example
Logger Name Assigned Level Inherited Level
@@ -72,16 +72,16 @@ Its a list of elements separated by comma where each element has its own meaning
4 - (Warn)
5 - (Error)
6 - (Fatal)
Flags: Define some extra modifications to do to logging message
Flags: Define some extra modifications to do to logging message
1 - Prefix Timestamp to the text
2 - Prefix Log Level to the text
4 - Prefix Log Filter type to the text
8 - Append timestamp to the log file name. Format: YYYY-MM-DD_HH-MM-SS
(Only used with Type = 2)
(Only used with Type = 2)
16 - Make a backup of existing file before overwrite
(Only used with Mode = w)
(Only used with Mode = w)
Depending on the type, elements optional1 and optional2 will take different
Depending on the type, elements optional1 and optional2 will take different
Colors (read as optional1 if Type = Console)
Format: "fatal error warn info debug trace"
@@ -111,22 +111,22 @@ Depending on the type, elements optional1 and optional2 will take different
Example:
Appender.Console1=1,2,6
Creates new appender to log to console any message with log level DEBUG
or higher and prefixes log type and level to the message.
Appender.Console2=1,5,1,13 11 9 5 3 1
Creates new appender to log to console any message with log level ERROR
or higher and prefixes timestamp to the message using colored text.
Appender.File=2,2,7,Auth.log,w
Creates new appender to log to file "Auth.log" any message with log level
DEBUG or higher and prefixes timestamp, type and level to message
Creates new appender to log to console any message with log level DEBUG
or higher and prefixes log type and level to the message.
Appender.Console2=1,5,1,13 11 9 5 3 1
Creates new appender to log to console any message with log level ERROR
or higher and prefixes timestamp to the message using colored text.
Appender.File=2,2,7,Auth.log,w
Creates new appender to log to file "Auth.log" any message with log level
DEBUG or higher and prefixes timestamp, type and level to message
In the example, having two different loggers to log to console is perfectly
legal but redundant.
legal but redundant.
Once we have the list of loggers to read, system will try to configure a new
logger from its config line. Logger config line follows the format:
@@ -188,7 +188,7 @@ Its a list of elements separated by comma where each element has its own meaning
6 - (Fatal)
AppenderList: List of appenders linked to logger
(Using spaces as separator).
--- EXAMPLES ---
EXAMPLE 1
@@ -198,23 +198,23 @@ logs for this server run. File should prefix timestamp, type and log level to
the messages. Console should prefix type and log level.
Appenders=Console Server
Loggers=Root
Loggers=Root
Appender.Console=1,5,6
Appender.Server=2,5,7,Server.log,w
Logger.Root=0,5,Console Server
Lets trace how system will log two different messages:
1) sLog->outError(LOG_FILTER_GUILD, "Guild 1 created");
System will try to find logger of type GUILD, as no logger is configured
for GUILD it will use Root logger. As message Log Level is equal or higher
than the Log level of logger the message is sent to the Appenders
configured in the Logger. "Console" and "Server".
Console will write: "ERROR [GUILD ] Guild 1 created"
Server will write to file "2012-08-15 ERROR [GUILD ] Guild 1 created"
System will try to find logger of type GUILD, as no logger is configured
for GUILD it will use Root logger. As message Log Level is equal or higher
than the Log level of logger the message is sent to the Appenders
configured in the Logger. "Console" and "Server".
Console will write: "ERROR [GUILD ] Guild 1 created"
Server will write to file "2012-08-15 ERROR [GUILD ] Guild 1 created"
2) sLog->outInfo(LOG_FILTER_CHARACTER, "Player Name Logged in");
System will try to find logger of type CHARACTER, as no logger is
configured for CHARACTER it will use Root logger. As message Log Level is
System will try to find logger of type CHARACTER, as no logger is
configured for CHARACTER it will use Root logger. As message Log Level is
not equal or higher than the Log level of logger the message its discarted.
EXAMPLE 2
@@ -223,23 +223,23 @@ Same example that above, but now i want to see all messages of level INFO on
file and server file should add timestamp on creation.
Appenders=Console Server
Loggers=Root
Loggers=Root
Appender.Console=1,5,6
Appender.Server=2,4,15,Server.log
Logger.Root=0,4,Console Server
Lets trace how system will log two different messages:
1) sLog->outError(LOG_FILTER_GUILD, "Guild 1 created");
Performs exactly as example 1.
Performs exactly as example 1.
2) sLog->outInfo(LOG_FILTER_CHARACTER, "Player Name Logged in");
System will try to find logger of type CHARACTER, as no logger is
configured for CHARACTER it will use Root logger. As message Log Level is
System will try to find logger of type CHARACTER, as no logger is
configured for CHARACTER it will use Root logger. As message Log Level is
equal or higher than the Log level of logger the message is sent to the
Appenders configured in the Logger. "Console" and "Server".
Appenders configured in the Logger. "Console" and "Server".
Console will discard msg as Log Level is not higher or equal to this
appender
Server will write to file
"2012-08-15 INFO [CHARACTER ] Guild 1 Player Name Logged in"
appender
Server will write to file
"2012-08-15 INFO [CHARACTER ] Guild 1 Player Name Logged in"
EXAMPLE 3
As a dev, i may be interested in logging just a particular part of the core
@@ -249,11 +249,11 @@ so i want SQLDEV to be logged to file without prefixes. All other messages
should only be logged to console, GUILD to TRACE and CHARACTER to INFO
Appenders=Console SQLDev
Loggers=Guild Characters SQLDev
Loggers=Guild Characters SQLDev
Appender.Console=1,1
Appender.SQLDev=2,2,0,SQLDev.log
Logger.Guild=24,1,Console
Logger.Characters=34,3,Console
Logger.Characters=34,3,Console
Logger.SQLDev=37,3,SQLDev
With this config, any message logger with a Log type different to GUILD,

View File

@@ -62,7 +62,7 @@ public:
{ "add", SEC_ADMINISTRATOR, true, NULL, "", addDisableCommandTable },
{ "remove", SEC_ADMINISTRATOR, true, NULL, "", removeDisableCommandTable },
{ NULL, 0, false, NULL, "", NULL }
};
};
static ChatCommand commandTable[] =
{
{ "disable", SEC_ADMINISTRATOR, false, NULL, "", disableCommandTable },
@@ -88,7 +88,7 @@ public:
uint32 entry = uint32(atoi(entryStr));
std::string disableTypeStr = "";
switch (disableType)
{
case DISABLE_TYPE_SPELL:
@@ -171,12 +171,12 @@ public:
default:
break;
}
PreparedStatement* stmt = NULL;
stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
stmt->setUInt32(0, entry);
stmt->setUInt8(1, disableType);
PreparedQueryResult result = WorldDatabase.Query(stmt);
stmt->setUInt8(1, disableType);
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (result)
{
handler->PSendSysMessage("This %s (Id: %u) is already disabled.", disableTypeStr.c_str(), entry);
@@ -290,8 +290,8 @@ public:
PreparedStatement* stmt = NULL;
stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
stmt->setUInt32(0, entry);
stmt->setUInt8(1, disableType);
PreparedQueryResult result = WorldDatabase.Query(stmt);
stmt->setUInt8(1, disableType);
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
{
handler->PSendSysMessage("This %s (Id: %u) is not disabled.", disableTypeStr.c_str(), entry);

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,7 @@ void AppenderDB::_write(LogMessage& message)
case LOG_FILTER_SQL_DRIVER:
case LOG_FILTER_SQL_DEV:
break; // Avoid infinite loop, PExecute triggers Logging with LOG_FILTER_SQL type
default:
default:
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG);
stmt->setUInt64(0, message.mtime);
stmt->setUInt32(1, realm);

View File

@@ -109,7 +109,7 @@ void Log::CreateAppenderFromConfig(const char* name)
if (++iter != tokens.end())
flags = AppenderFlags(atoi(*iter));
switch (type)
{
case APPENDER_CONSOLE: