Core/Commands: Enable SQL query logging by config and command )patch by leak)

Closes issue 4853.

--HG--
branch : trunk
This commit is contained in:
click
2010-11-19 13:13:07 +01:00
parent 67cd8d18e1
commit 67fade84d3
13 changed files with 90 additions and 56 deletions
@@ -530,6 +530,18 @@ bool ChatHandler::HandleServerSetDiffTimeCommand(const char *args)
return true;
}
/// toggle sql driver query logging
bool ChatHandler::HandleServerToggleQueryLogging(const char* /* args */)
{
sLog.SetSQLDriverQueryLogging(!sLog.GetSQLDriverQueryLogging());
if(sLog.GetSQLDriverQueryLogging())
PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_ENABLED);
else
PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_DISABLED);
return true;
}
/// @}
#ifdef linux
+7 -1
View File
@@ -405,9 +405,14 @@ CleanCharacterDB = 0
#
# SQLDriverLogFile
# Log file of SQL driver events.
# For effective query logging you need to build in debug configuration.
# For effective query logging you need to configure SQLDriverQueryLogging.
# Default: "" - Empty name for disable
#
# SQLDriverQueryLogging
# Log SQL queries to the SQLDriverLogFile and console
# Default: 0 - disabled (Query errors only)
# 1 - enabled (Full query logging - may have performance impact)
#
# LogColors
# Color for messages (format "normal basic detail debug")
# Default: "" - no colors
@@ -538,6 +543,7 @@ RaLogFile = "ra_commands.log"
ArenaLogFile = ""
ArenaLog.ExtendedInfo = 0
SQLDriverLogFile = ""
SQLDriverQueryLogging = 0
LogColors = ""
EnableLogDB = 0
DBLogLevel = 2