Core/Log: Implement log masks for debug log level, to allow selective debug output. Update your worldserver.conf.

This commit is contained in:
Machiavelli
2011-02-20 20:16:34 +01:00
parent 45db1591a4
commit e07e20ffca
99 changed files with 1046 additions and 1092 deletions

View File

@@ -391,12 +391,12 @@ public:
}
else
{
sLog->outDebug("Sending opcode: unknown type '%s'", type.c_str());
sLog->outError("Sending opcode: unknown type '%s'", type.c_str());
break;
}
}
ifs.close();
sLog->outDebug("Sending opcode %u", data.GetOpcode());
sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending opcode %u", data.GetOpcode());
data.hexlike();
player->GetSession()->SendPacket(&data);
handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName());
@@ -1053,14 +1053,12 @@ public:
if (isint32)
{
iValue = (uint32)atoi(py);
sLog->outDebug(handler->GetTrinityString(LANG_SET_UINT), GUID_LOPART(guid), Opcode, iValue);
target->SetUInt32Value(Opcode , iValue);
handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), Opcode,iValue);
}
else
{
fValue = (float)atof(py);
sLog->outDebug(handler->GetTrinityString(LANG_SET_FLOAT), GUID_LOPART(guid), Opcode, fValue);
target->SetFloatValue(Opcode , fValue);
handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), Opcode,fValue);
}
@@ -1104,13 +1102,11 @@ public:
if (isint32)
{
iValue = target->GetUInt32Value(Opcode);
sLog->outDebug(handler->GetTrinityString(LANG_GET_UINT), GUID_LOPART(guid), Opcode, iValue);
handler->PSendSysMessage(LANG_GET_UINT_FIELD, GUID_LOPART(guid), Opcode, iValue);
}
else
{
fValue = target->GetFloatValue(Opcode);
sLog->outDebug(handler->GetTrinityString(LANG_GET_FLOAT), GUID_LOPART(guid), Opcode, fValue);
handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, GUID_LOPART(guid), Opcode, fValue);
}
@@ -1137,8 +1133,6 @@ public:
return false;
}
sLog->outDebug(handler->GetTrinityString(LANG_CHANGE_32BIT), Opcode, Value);
int CurrentValue = (int)handler->GetSession()->GetPlayer()->GetUInt32Value(Opcode);
CurrentValue += Value;
@@ -1223,8 +1217,6 @@ public:
if (Value > 32) //uint32 = 32 bits
return false;
sLog->outDebug(handler->GetTrinityString(LANG_SET_32BIT), Opcode, Value);
uint32 iValue = Value ? 1 << (Value - 1) : 0;
target->SetUInt32Value(Opcode , iValue);

View File

@@ -172,8 +172,6 @@ public:
return false;
}
sLog->outDebug(handler->GetTrinityString(LANG_GAMEOBJECT_CURRENT), gInfo->name, db_lowGUID, x, y, z, o);
map->Add(pGameObj);
// TODO: is it really necessary to add both the real and DB table guid here ?

View File

@@ -75,8 +75,6 @@ public:
*/
static bool HandleWpAddCommand(ChatHandler* handler, const char* args)
{
sLog->outDebug("DEBUG: HandleWpAddCommand");
// optional
char* path_number = NULL;
uint32 pathid = 0;
@@ -96,7 +94,6 @@ public:
QueryResult result = WorldDatabase.Query("SELECT MAX(id) FROM waypoint_data");
uint32 maxpathid = result->Fetch()->GetInt32();
pathid = maxpathid+1;
sLog->outDebug("DEBUG: HandleWpAddCommand - New path started.");
handler->PSendSysMessage("%s%s|r", "|cff00ff00", "New path started.");
}
}
@@ -108,13 +105,10 @@ public:
if (!pathid)
{
sLog->outDebug("DEBUG: HandleWpAddCommand - Current creature haven't loaded path.");
handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Current creature haven't loaded path.");
return true;
}
sLog->outDebug("DEBUG: HandleWpAddCommand - point == 0");
QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid);
if (result)
@@ -147,7 +141,7 @@ public:
// Did player provide a path_id?
if (!path_number)
sLog->outDebug("DEBUG: HandleWpLoadPathCommand - No path number provided");
return false;
if (!target)
{
@@ -167,7 +161,7 @@ public:
if (!pathid)
{
handler->PSendSysMessage("%s%s|r", "|cffff33ff", "No vallid path number provided.");
handler->PSendSysMessage("%s%s|r", "|cffff33ff", "No valid path number provided.");
return true;
}
@@ -452,8 +446,6 @@ public:
static bool HandleWpModifyCommand(ChatHandler* handler, const char* args)
{
sLog->outDebug("DEBUG: HandleWpModifyCommand");
if (!*args)
return false;
@@ -491,7 +483,6 @@ public:
return false;
}
sLog->outDebug("DEBUG: HandleWpModifyCommand - User did select an NPC");
// The visual waypoint
Creature* wpCreature = NULL;
wpGuid = target->GetGUIDLow();
@@ -513,8 +504,6 @@ public:
if (!result)
{
sLog->outDebug("DEBUG: HandleWpModifyCommand - No waypoint found - used 'wpguid'");
handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUIDLow());
// Select waypoint number from database
// Since we compare float values, we have to deal with
@@ -531,7 +520,6 @@ public:
return true;
}
}
sLog->outDebug("DEBUG: HandleWpModifyCommand - After getting wpGuid");
do
{
@@ -546,8 +534,6 @@ public:
arg_str = strtok((char*)NULL, " ");
}
sLog->outDebug("DEBUG: HandleWpModifyCommand - Parameters parsed - now execute the command");
// Check for argument
if (show != "del" && show != "move" && arg_str == NULL)
{
@@ -644,8 +630,6 @@ public:
static bool HandleWpShowCommand(ChatHandler* handler, const char* args)
{
sLog->outDebug("DEBUG: HandleWpShowCommand");
if (!*args)
return false;
@@ -656,7 +640,6 @@ public:
// second arg: GUID (optional, if a creature is selected)
char* guid_str = strtok((char*)NULL, " ");
sLog->outDebug("DEBUG: HandleWpShowCommand: show_str: %s guid_str: %s", show_str, guid_str);
uint32 pathid = 0;
Creature* target = handler->getSelectedCreature();
@@ -665,7 +648,6 @@ public:
if (!guid_str)
{
sLog->outDebug("DEBUG: HandleWpShowCommand: !guid_str");
// No PathID provided
// -> Player must have selected a creature
@@ -680,7 +662,6 @@ public:
}
else
{
sLog->outDebug("|cff00ff00DEBUG: HandleWpShowCommand: PathID provided|r");
// PathID provided
// Warn if player also selected a creature
// -> Creature selection is ignored <-
@@ -690,13 +671,9 @@ public:
pathid = atoi((char*)guid_str);
}
sLog->outDebug("DEBUG: HandleWpShowCommand: danach");
std::string show = show_str;
uint32 Maxpoint;
sLog->outDebug("DEBUG: HandleWpShowCommand: PathID: %u", pathid);
//handler->PSendSysMessage("wpshow - show: %s", show);
// Show info for the selected waypoint
@@ -811,7 +788,6 @@ public:
return false;
}
sLog->outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point);
// set "wpguid" column to the visual waypoint
WorldDatabase.PExecute("UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point);