diff --git a/code/__DEFINES/logging.dm b/code/__DEFINES/logging.dm new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/__HELPERS/logging.dm b/code/__HELPERS/logging.dm index ce6ce9d7650..3dd0f9235bd 100644 --- a/code/__HELPERS/logging.dm +++ b/code/__HELPERS/logging.dm @@ -98,7 +98,8 @@ /proc/log_after_setup(var/message) if(ticker && ticker.current_state > GAME_STATE_SETTING_UP) to_chat(world, "[message]") - log_to_dd(message) + log_to_dd(message) + // Helper procs for building detailed log lines /proc/datum_info_line(var/datum/d) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 889a0824f35..15bd69df376 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -161,7 +161,7 @@ Proc for attack log creation, because really why not 6 is whether the attack should be logged to the log file and shown to admins */ -proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=null, var/admin=1) //Victim : Attacker : what they did : what they did it with : extra notes +proc/add_logs(mob/user, mob/target, what_done, var/object=null, var/addition=null, var/admin=1) var/list/ignore=list("shaked","CPRed","grabbed","punched") if(!user) return @@ -301,7 +301,7 @@ proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=nul var/mob/living/L = M var/status switch(M.stat) - if(CONSCIOUS) + if(CONSCIOUS) status = "Alive" if(UNCONSCIOUS) status = "Unconscious" diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 40eaa9007a1..d5b75eb4c7c 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -404,7 +404,7 @@ proc/checkhtml(var/t) var/index = findtext(text, char) var/keylength = length(char) while(index) - log_debug("Bad string given to dmm encoder! [text]") + log_runtime(EXCEPTION("Bad string given to dmm encoder! [text]")) // Replace w/ underscore to prevent "{4;" from cheesing the radar // Should probably also use canon text replacing procs text = copytext(text, 1, index) + "_" + copytext(text, index+keylength) diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 005ef4c2fc9..7e4fca82c32 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -79,7 +79,7 @@ if(4.0) return EAST if(8.0) return WEST else - log_to_dd("UNKNOWN DIRECTION: [direction]") + log_runtime(EXCEPTION("UNKNOWN DIRECTION: [direction]")) /proc/dir2text(direction) switch(direction) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 1fa83b66513..1077e2fde8a 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -58,14 +58,15 @@ return 1 if(istype(M,/mob/living/carbon/brain)) - messagesource = M:container + var/mob/living/carbon/brain/B = M + messagesource = B.container if(hitsound && force > 0) playsound(loc, hitsound, 50, 1, -1) ///////////////////////// user.lastattacked = M M.lastattacker = user - add_logs(M, user, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])") + add_logs(user, M, "attacked", name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])") if(!iscarbon(user)) M.LAssailant = null diff --git a/code/_onclick/rig.dm b/code/_onclick/rig.dm index 31e6f287564..41bf57a14f8 100644 --- a/code/_onclick/rig.dm +++ b/code/_onclick/rig.dm @@ -25,7 +25,7 @@ to_chat(src, "Hardsuit activation mode set to control-click.") else // should never get here, but just in case: - log_debug("Bad hardsuit click mode: [hardsuit_click_mode] - expected 0 to [MAX_HARDSUIT_CLICK_MODE]") + log_runtime(EXCEPTION("Bad hardsuit click mode: [hardsuit_click_mode] - expected 0 to [MAX_HARDSUIT_CLICK_MODE]"), src) to_chat(src, "Somehow you bugged the system. Setting your hardsuit mode to middle-click.") hardsuit_click_mode = MIDDLE_CLICK diff --git a/code/controllers/ProcessScheduler/core/process.dm b/code/controllers/ProcessScheduler/core/process.dm index b29ef0f2fa2..ed33a738bf3 100644 --- a/code/controllers/ProcessScheduler/core/process.dm +++ b/code/controllers/ProcessScheduler/core/process.dm @@ -199,6 +199,7 @@ var/msg = "[name] process hung at tick #[ticks]. Process was unresponsive for [(TimeOfGame - run_start) / 10] seconds and was restarted. Last task: [last_task]. Last Object Type: [lastObjType]" log_debug(msg) message_admins(msg) + log_runtime(EXCEPTION(msg), src) main.restartProcess(src.name) @@ -207,6 +208,7 @@ var/msg = "[name] process was killed at tick #[ticks]." log_debug(msg) message_admins(msg) + log_runtime(EXCEPTION(msg), src) //finished() // Allow inheritors to clean up if needed diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index f990ac7f3a1..7ce10664aee 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -7,12 +7,12 @@ if(!usr.client || !usr.client.holder) - to_chat(usr, "\red You need to be an administrator to access this.") + to_chat(usr, "You need to be an administrator to access this.") return var/title = "" - var/body = "" + var/list/body = list() if(!D) return if(istype(D, /atom)) @@ -319,7 +319,7 @@ body } "} html += "" - html += body + html += body.Join("") html += {"