diff --git a/code/__HELPERS/logging.dm b/code/__HELPERS/logging.dm index e8a403afdc3..654bebf8ec5 100644 --- a/code/__HELPERS/logging.dm +++ b/code/__HELPERS/logging.dm @@ -1,8 +1,10 @@ //print an error message to world.log +#define ERROR(MSG) error(MSG + " in " + __FILE__ + " at " + __LINE__ + " src: " + src + " usr: " + usr) /proc/error(msg) world.log << "## ERROR: [msg]" //print a warning message to world.log +#define WARNING(MSG) warning(MSG + " in " + "[__FILE__]" + " at line " + "[__LINE__]" + " src: " + "[src]" + " usr: " + "[usr]") /proc/warning(msg) world.log << "## WARNING: [msg]" diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 0abb637cce9..c0bbe14d9a1 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -45,7 +45,7 @@ var/const/tk_maxrange = 15 O.host = user O.focus_object(src) else - warning("Strange attack_tk(): TK([TK in user.mutations]) empty hand([!user.get_active_hand()])") + WARNING("Strange attack_tk(): TK([TK in user.mutations]) empty hand([!user.get_active_hand()])") return diff --git a/code/controllers/_DynamicAreaLighting_TG.dm b/code/controllers/_DynamicAreaLighting_TG.dm index 4b04963a45c..15486fc72f0 100644 --- a/code/controllers/_DynamicAreaLighting_TG.dm +++ b/code/controllers/_DynamicAreaLighting_TG.dm @@ -121,7 +121,7 @@ atom turf/New() ..() if(luminosity) - if(light) warning("[type] - Don't set lights up manually during New(), We do it automatically.") + if(light) WARNING("[type] - Don't set lights up manually during New(), We do it automatically.") trueLuminosity = luminosity * luminosity light = new(src) @@ -134,7 +134,7 @@ atom/movable/New() if(loc:lighting_lumcount > 1) UpdateAffectingLights() if(luminosity) - if(light) warning("[type] - Don't set lights up manually during New(), We do it automatically.") + if(light) WARNING("[type] - Don't set lights up manually during New(), We do it automatically.") trueLuminosity = luminosity * luminosity light = new(src) diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 0d29218a025..737481c7cf9 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -26,10 +26,10 @@ return if (!network) - world.log << "A computer lacks a network at [x],[y],[z]." + ERROR("A computer lacks a network at [x],[y],[z].") return if (!(istype(network,/list))) - world.log << "The computer at [x],[y],[z] has a network that is not a list!" + ERROR("The computer at [x],[y],[z] has a network that is not a list!") return if(..()) diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index 5222fb5af81..c4b7c21a2cf 100644 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -292,7 +292,7 @@ AI MODULES laws += line if(!laws.len) //Failsafe if something goes wrong with silicon_laws.txt. - warning("ERROR: empty custom board created, empty custom board deleted. Please check silicon_laws.txt.") + WARNING("ERROR: empty custom board created, empty custom board deleted. Please check silicon_laws.txt. (this may be intended by the server host)") del(src) /****************** T.Y.R.A.N.T. *****************/ diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index 3417b1eae10..5fe1ebf7ca5 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -136,7 +136,7 @@ user << "You take \a [Sign] from [src]." signs-- else - warning("[src] signs ([signs]) didn't match contents") + WARNING("Signs ([signs]) didn't match contents") signs = 0 update_icon() diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index a06a525a74c..29e19589ea7 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -390,7 +390,7 @@ datum handle_reactions() return 0 else - warning("[my_atom] attempted to add a reagent called '[reagent]' which doesn't exist. ([usr])") + WARNING("[my_atom] attempted to add a reagent called ' [reagent] ' which doesn't exist. ([usr])") handle_reactions()