Files
Bubberstation/code/__HELPERS/logging/ui.dm
SkyratBot e2938ac88c [MIRROR] splits out tgui from the debug master category [MDB IGNORE] (#22368)
* splits out tgui from the debug master category (#76428)

Splits out tgui from the debug master category at the request of @ Fikou
Removes pointless overrides of internal_format since the default is now
FALSE and also adds an additional comment about ensuring the shit works
if you change the default.

I believe the original reason was that fikou didnt want to sort through
the entire debug log for tgui stuff.

* splits out tgui from the debug master category

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
2023-07-11 15:44:53 -07:00

40 lines
919 B
Plaintext

/proc/log_href(text, list/data)
logger.Log(LOG_CATEGORY_HREF, text, data)
/**
* Appends a tgui-related log entry. All arguments are optional.
*/
/proc/log_tgui(
user,
message,
context,
datum/tgui_window/window,
datum/src_object,
)
var/entry = ""
// Insert user info
if(!user)
entry += "<nobody>"
else if(istype(user, /mob))
var/mob/mob = user
entry += "[mob.ckey] (as [mob] at [mob.x],[mob.y],[mob.z])"
else if(istype(user, /client))
var/client/client = user
entry += "[client.ckey]"
// Insert context
if(context)
entry += " in [context]"
else if(window)
entry += " in [window.id]"
// Resolve src_object
if(!src_object && window?.locked_by)
src_object = window.locked_by.src_object
// Insert src_object info
if(src_object)
entry += "\nUsing: [src_object.type] [REF(src_object)]"
// Insert message
if(message)
entry += "\n[message]"
logger.Log(LOG_CATEGORY_HREF_TGUI, entry)