diff --git a/code/_helpers/logging.dm b/code/_helpers/logging.dm index 29b72ff6f7..06b9fc72fa 100644 --- a/code/_helpers/logging.dm +++ b/code/_helpers/logging.dm @@ -27,7 +27,7 @@ /proc/log_debug(text) if (config.log_debug) - diary << "\[[time_stamp()]]DEBUG: [text][log_end]" + debug_log << "\[[time_stamp()]]DEBUG: [text][log_end]" for(var/client/C in admins) if(C.is_preference_enabled(/datum/client_preference/debug/show_debug_logs)) @@ -112,6 +112,10 @@ if(config.log_world_output) diary << "\[[time_stamp()]]DD_OUTPUT: [text][log_end]" +/proc/log_error(text) + world.log << text + error_log << "\[[time_stamp()]]RUNTIME: [text][log_end]" + /proc/log_misc(text) diary << "\[[time_stamp()]]MISC: [text][log_end]" diff --git a/code/controllers/subsystems/atoms.dm b/code/controllers/subsystems/atoms.dm index 6b5669878c..5b09b186bb 100644 --- a/code/controllers/subsystems/atoms.dm +++ b/code/controllers/subsystems/atoms.dm @@ -135,9 +135,7 @@ SUBSYSTEM_DEF(atoms) /datum/controller/subsystem/atoms/Shutdown() var/initlog = InitLog() if(initlog) - //text2file(initlog, "[GLOB.log_directory]/initialize.log") - var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") - text2file(initlog, "data/logs/[date_string]-initialize.log") + text2file(initlog, "[log_path]-initialize.log") #undef BAD_INIT_QDEL_BEFORE #undef BAD_INIT_DIDNT_INIT diff --git a/code/controllers/subsystems/garbage.dm b/code/controllers/subsystems/garbage.dm index eff85a3627..b4d43a8d3f 100644 --- a/code/controllers/subsystems/garbage.dm +++ b/code/controllers/subsystems/garbage.dm @@ -81,8 +81,7 @@ SUBSYSTEM_DEF(garbage) dellog += "\tIgnored force: [I.no_respect_force] times" if (I.no_hint) dellog += "\tNo hint: [I.no_hint] times" - var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") - text2file(dellog.Join(), "data/logs/[date_string]-qdel.log") + text2file(dellog.Join(), "[log_path]-qdel.log") /datum/controller/subsystem/garbage/fire() //the fact that this resets its processing each fire (rather then resume where it left off) is intentional. diff --git a/code/controllers/subsystems/overlays.dm b/code/controllers/subsystems/overlays.dm index 352102e175..ed9b81016f 100644 --- a/code/controllers/subsystems/overlays.dm +++ b/code/controllers/subsystems/overlays.dm @@ -29,9 +29,7 @@ var/global/image/appearance_bro = new() // Temporarily super-global because of B /datum/controller/subsystem/overlays/Shutdown() - //text2file(render_stats(stats), "[GLOB.log_directory]/overlay.log") - var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") - text2file(render_stats(stats), "data/logs/[date_string]-overlay.log") + text2file(render_stats(stats), "[log_path]-overlay.log") /datum/controller/subsystem/overlays/Recover() overlay_icon_state_caches = SSoverlays.overlay_icon_state_caches diff --git a/code/global.dm b/code/global.dm index f2a79c8868..c77cd68011 100644 --- a/code/global.dm +++ b/code/global.dm @@ -21,7 +21,10 @@ var/global/list/global_map = null // Noises made when hit while typing. var/list/hit_appends = list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF") +var/log_path = "data/logs/" //See world.dm for the full calculated path var/diary = null +var/error_log = null +var/debug_log = null var/href_logfile = null // var/station_name = "Northern Star" // var/const/station_orig = "Northern Star" //station_name can't be const due to event prefix/suffix diff --git a/code/modules/admin/verbs/getlogs.dm b/code/modules/admin/verbs/getlogs.dm index eac11fcac0..3f6e4c9e74 100644 --- a/code/modules/admin/verbs/getlogs.dm +++ b/code/modules/admin/verbs/getlogs.dm @@ -85,7 +85,7 @@ set name = "Show Server Log" set desc = "Shows today's server log." - var/path = "data/logs/[time2text(world.realtime,"YYYY/MM-Month/DD-Day")].log" + var/path = "[log_path].log" if( fexists(path) ) src << run( file(path) ) else @@ -99,7 +99,10 @@ set category = "Admin" set name = "Show Server Attack Log" set desc = "Shows today's server attack log." + + to_chat(usr,"This verb doesn't actually do anything.") + /* var/path = "data/logs/[time2text(world.realtime,"YYYY/MM-Month/DD-Day")] Attack.log" if( fexists(path) ) src << run( file(path) ) @@ -109,3 +112,5 @@ usr << run( file(path) ) feedback_add_details("admin_verb","SSAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return + */ + \ No newline at end of file diff --git a/code/modules/error_handler/error_handler.dm b/code/modules/error_handler/error_handler.dm index de71bfc1ca..db3843a8c9 100644 --- a/code/modules/error_handler/error_handler.dm +++ b/code/modules/error_handler/error_handler.dm @@ -8,7 +8,7 @@ var/total_runtimes_skipped = 0 #ifdef DEBUG /world/Error(var/exception/e, var/datum/e_src) if(!istype(e)) // Something threw an unusual exception - log_to_dd("\[[time_stamp()]] Uncaught exception: [e]") + log_error("\[[time_stamp()]] Uncaught exception: [e]") return ..() if(!error_last_seen) // A runtime is occurring too early in start-up initialization return ..() @@ -39,7 +39,7 @@ var/total_runtimes_skipped = 0 var/skipcount = abs(error_cooldown[erroruid]) - 1 error_cooldown[erroruid] = 0 if(skipcount > 0) - log_to_dd("\[[time_stamp()]] Skipped [skipcount] runtimes in [e.file],[e.line].") + log_error("\[[time_stamp()]] Skipped [skipcount] runtimes in [e.file],[e.line].") error_cache.logError(e, skipCount = skipcount) error_last_seen[erroruid] = world.time error_cooldown[erroruid] = cooldown @@ -95,9 +95,9 @@ var/total_runtimes_skipped = 0 desclines += " (This error will now be silenced for [ERROR_SILENCE_TIME / 600] minutes)" // Now to actually output the error info... - log_to_dd("\[[time_stamp()]] Runtime in [e.file],[e.line]: [e]") + log_error("\[[time_stamp()]] Runtime in [e.file],[e.line]: [e]") for(var/line in desclines) - log_to_dd(line) + log_error(line) if(error_cache) error_cache.logError(e, desclines, e_src = e_src) diff --git a/code/world.dm b/code/world.dm index 635aa8d537..ed3b5efb9b 100644 --- a/code/world.dm +++ b/code/world.dm @@ -42,10 +42,12 @@ var/global/datum/global_init/init = new () /world/New() world.log << "Map Loading Complete" //logs - var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") - href_logfile = file("data/logs/[date_string] hrefs.htm") - diary = file("data/logs/[date_string].log") - diary << "[log_end]\n[log_end]\nStarting up. [time2text(world.timeofday, "hh:mm.ss")][log_end]\n---------------------[log_end]" + log_path += time2text(world.realtime, "YYYY/MM-Month/DD-Day/round-hh-mm-ss") + diary = file("[log_path].log") + href_logfile = file("[log_path]-hrefs.htm") + error_log = file("[log_path]-error.log") + debug_log = file("[log_path]-debug.log") + debug_log << "[log_end]\n[log_end]\nStarting up. [time_stamp()][log_end]\n---------------------[log_end]" changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently if(byond_version < RECOMMENDED_VERSION)