POLARIS: Moves daily logs into being folders rather than files

This commit is contained in:
Arokha Sieyes
2018-03-10 17:17:16 -05:00
committed by Leshana
parent 73838e0a62
commit 7f93f3cca7
8 changed files with 27 additions and 18 deletions

View File

@@ -27,7 +27,7 @@
/proc/log_debug(text) /proc/log_debug(text)
if (config.log_debug) 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) for(var/client/C in admins)
if(C.is_preference_enabled(/datum/client_preference/debug/show_debug_logs)) if(C.is_preference_enabled(/datum/client_preference/debug/show_debug_logs))
@@ -112,6 +112,10 @@
if(config.log_world_output) if(config.log_world_output)
diary << "\[[time_stamp()]]DD_OUTPUT: [text][log_end]" 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) /proc/log_misc(text)
diary << "\[[time_stamp()]]MISC: [text][log_end]" diary << "\[[time_stamp()]]MISC: [text][log_end]"

View File

@@ -135,9 +135,7 @@ SUBSYSTEM_DEF(atoms)
/datum/controller/subsystem/atoms/Shutdown() /datum/controller/subsystem/atoms/Shutdown()
var/initlog = InitLog() var/initlog = InitLog()
if(initlog) if(initlog)
//text2file(initlog, "[GLOB.log_directory]/initialize.log") text2file(initlog, "[log_path]-initialize.log")
var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day")
text2file(initlog, "data/logs/[date_string]-initialize.log")
#undef BAD_INIT_QDEL_BEFORE #undef BAD_INIT_QDEL_BEFORE
#undef BAD_INIT_DIDNT_INIT #undef BAD_INIT_DIDNT_INIT

View File

@@ -81,8 +81,7 @@ SUBSYSTEM_DEF(garbage)
dellog += "\tIgnored force: [I.no_respect_force] times" dellog += "\tIgnored force: [I.no_respect_force] times"
if (I.no_hint) if (I.no_hint)
dellog += "\tNo hint: [I.no_hint] times" dellog += "\tNo hint: [I.no_hint] times"
var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") text2file(dellog.Join(), "[log_path]-qdel.log")
text2file(dellog.Join(), "data/logs/[date_string]-qdel.log")
/datum/controller/subsystem/garbage/fire() /datum/controller/subsystem/garbage/fire()
//the fact that this resets its processing each fire (rather then resume where it left off) is intentional. //the fact that this resets its processing each fire (rather then resume where it left off) is intentional.

View File

@@ -31,9 +31,7 @@ var/global/image/appearance_bro = new() // Temporarily super-global because of B
/datum/controller/subsystem/overlays/Shutdown() /datum/controller/subsystem/overlays/Shutdown()
//text2file(render_stats(stats), "[GLOB.log_directory]/overlay.log") text2file(render_stats(stats), "[log_path]-overlay.log")
var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day")
text2file(render_stats(stats), "data/logs/[date_string]-overlay.log")
/datum/controller/subsystem/overlays/Recover() /datum/controller/subsystem/overlays/Recover()
overlay_icon_state_caches = SSoverlays.overlay_icon_state_caches overlay_icon_state_caches = SSoverlays.overlay_icon_state_caches

View File

@@ -21,7 +21,10 @@ var/global/list/global_map = null
// Noises made when hit while typing. // Noises made when hit while typing.
var/list/hit_appends = list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF") 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/diary = null
var/error_log = null
var/debug_log = null
var/href_logfile = null var/href_logfile = null
// var/station_name = "Northern Star" // var/station_name = "Northern Star"
// var/const/station_orig = "Northern Star" //station_name can't be const due to event prefix/suffix // var/const/station_orig = "Northern Star" //station_name can't be const due to event prefix/suffix

View File

@@ -85,7 +85,7 @@
set name = "Show Server Log" set name = "Show Server Log"
set desc = "Shows today's 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) ) if( fexists(path) )
src << run( file(path) ) src << run( file(path) )
else else
@@ -99,7 +99,10 @@
set category = "Admin" set category = "Admin"
set name = "Show Server Attack Log" set name = "Show Server Attack Log"
set desc = "Shows today's 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" var/path = "data/logs/[time2text(world.realtime,"YYYY/MM-Month/DD-Day")] Attack.log"
if( fexists(path) ) if( fexists(path) )
src << run( file(path) ) src << run( file(path) )
@@ -109,3 +112,5 @@
usr << run( file(path) ) 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! feedback_add_details("admin_verb","SSAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return return
*/

View File

@@ -8,7 +8,7 @@ var/total_runtimes_skipped = 0
#ifdef DEBUG #ifdef DEBUG
/world/Error(var/exception/e, var/datum/e_src) /world/Error(var/exception/e, var/datum/e_src)
if(!istype(e)) // Something threw an unusual exception if(!istype(e)) // Something threw an unusual exception
log_to_dd("\[[time_stamp()]] Uncaught exception: [e]") log_error("\[[time_stamp()]] Uncaught exception: [e]")
return ..() return ..()
if(!error_last_seen) // A runtime is occurring too early in start-up initialization if(!error_last_seen) // A runtime is occurring too early in start-up initialization
return ..() return ..()
@@ -39,7 +39,7 @@ var/total_runtimes_skipped = 0
var/skipcount = abs(error_cooldown[erroruid]) - 1 var/skipcount = abs(error_cooldown[erroruid]) - 1
error_cooldown[erroruid] = 0 error_cooldown[erroruid] = 0
if(skipcount > 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_cache.logError(e, skipCount = skipcount)
error_last_seen[erroruid] = world.time error_last_seen[erroruid] = world.time
error_cooldown[erroruid] = cooldown 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)" desclines += " (This error will now be silenced for [ERROR_SILENCE_TIME / 600] minutes)"
// Now to actually output the error info... // 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) for(var/line in desclines)
log_to_dd(line) log_error(line)
if(error_cache) if(error_cache)
error_cache.logError(e, desclines, e_src = e_src) error_cache.logError(e, desclines, e_src = e_src)

View File

@@ -42,10 +42,12 @@ var/global/datum/global_init/init = new ()
/world/New() /world/New()
world.log << "Map Loading Complete" world.log << "Map Loading Complete"
//logs //logs
var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") log_path += time2text(world.realtime, "YYYY/MM-Month/DD-Day/round-hh-mm-ss")
href_logfile = file("data/logs/[date_string] hrefs.htm") diary = file("[log_path].log")
diary = file("data/logs/[date_string].log") href_logfile = file("[log_path]-hrefs.htm")
diary << "[log_end]\n[log_end]\nStarting up. [time2text(world.timeofday, "hh:mm.ss")][log_end]\n---------------------[log_end]" 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 changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently
if(byond_version < RECOMMENDED_VERSION) if(byond_version < RECOMMENDED_VERSION)