Implement first pieces of #log

This commit is contained in:
Akkadius 2015-01-20 23:18:23 -06:00
parent 7101d84b27
commit 1871c3f24f
2 changed files with 28 additions and 1 deletions

View File

@ -427,7 +427,8 @@ int command_init(void) {
command_add("close_shop", nullptr, 100, command_merchantcloseshop) ||
command_add("shownumhits", "Shows buffs numhits for yourself.", 0, command_shownumhits) ||
command_add("crashtest", "- Crash the zoneserver", 255, command_crashtest) ||
command_add("logtest", "Performs log performance testing.", 250, command_logtest)
command_add("logtest", "Performs log performance testing.", 250, command_logtest) ||
command_add("log", "Manage anything to do with logs", 250, command_log)
)
{
command_deinit();
@ -10414,4 +10415,29 @@ void command_crashtest(Client *c, const Seperator *sep)
c->Message(0, "Alright, now we get an GPF ;) ");
char* gpf = 0;
memcpy(gpf, "Ready to crash", 30);
}
void command_log(Client *c, const Seperator *sep){
if (sep->argnum > 0) {
if(strcasecmp(sep->arg[1], "reload_all") == 0){
c->Message(0, "Yes this is working");
}
if (strcasecmp(sep->arg[1], "list_settings") == 0){
c->Message(0, "[Category ID | log_to_console | log_to_file | log_to_gmsay | Category Description]");
int redisplay_columns = 0;
for (int i = 0; i < Logs::LogCategory::MaxCategoryID; i++){
if (redisplay_columns == 10){
c->Message(0, "[Category ID | log_to_console | log_to_file | log_to_gmsay | Category Description]");
redisplay_columns = 0;
}
c->Message(0, StringFormat("--- %i | %u | %u | %u | %s", i, Log.log_settings[i].log_to_console, Log.log_settings[i].log_to_file, Log.log_settings[i].log_to_gmsay, Logs::LogCategoryName[i]).c_str());
redisplay_columns++;
}
}
}
else {
c->Message(0, "#log usage:");
c->Message(0, "--- #log reload_all - Reloads all rules defined in database in world and all zone processes");
c->Message(0, "--- #log list_settings - Shows current log settings and categories");
}
}

View File

@ -323,6 +323,7 @@ void command_merchantopenshop(Client *c, const Seperator *sep);
void command_merchantcloseshop(Client *c, const Seperator *sep);
void command_shownumhits(Client *c, const Seperator *sep);
void command_logtest(Client *c, const Seperator *sep);
void command_log(Client *c, const Seperator *sep);
#ifdef EQPROFILE
void command_profiledump(Client *c, const Seperator *sep);