From b5f3379a0fc8c1ec813ffb9dc77dc3808251648c Mon Sep 17 00:00:00 2001 From: Mloc-Argent Date: Thu, 2 Jan 2014 21:38:15 +0000 Subject: [PATCH] Fixes runtime logging and makes it a config option. Option starts off by default, since that could be seen as the original behavior... Signed-off-by: Mloc-Argent Conflicts: code/controllers/configuration.dm config/example/config.txt --- code/controllers/configuration.dm | 8 +++----- code/world.dm | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 44f340290fc..e23c6b50071 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -19,6 +19,7 @@ var/log_pda = 0 // log pda messages var/log_runtimes = 0 // Logs all runtimes. var/log_hrefs = 0 // logs all links clicked in-game. Could be used for debugging and tracking down exploits + var/log_runtime = 0 // logs world.log to a file var/sql_enabled = 1 // for sql switching var/allow_admin_ooccolor = 0 // Allows admins with relevant permissions to have their own ooc colour var/allow_vote_restart = 0 // allow votes to restart @@ -248,14 +249,11 @@ if ("log_pda") config.log_pda = 1 - if ("log_runtimes") - config.log_runtimes = 1 - if ("log_hrefs") config.log_hrefs = 1 - if ("mentors") - config.mods_are_mentors = 1 + if ("log_runtime") + config.log_runtime = 1 if ("mentors") config.mods_are_mentors = 1 diff --git a/code/world.dm b/code/world.dm index 492ca853bcc..45fb639d69c 100644 --- a/code/world.dm +++ b/code/world.dm @@ -11,7 +11,6 @@ /world/New() //logs var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") - log = file("data/logs/runtime/[time2text(world.realtime,"YYYY-MM")].log") //funtimelog href_logfile = file("data/logs/[date_string] hrefs.htm") diary = file("data/logs/[date_string].log") diaryofmeanpeople = file("data/logs/[date_string] Attack.log") @@ -31,6 +30,9 @@ // dumb and hardcoded but I don't care~ config.server_name += " #[(world.port % 1000) / 100]" + if(config && config.log_runtime) + log = file("data/logs/runtime/[time2text(world.realtime,"YYYY-MM-DD-(hh-mm-ss)")]-runtime.log") + callHook("startup") src.update_status()