JSON Logging Take Two (#73604)

## About The Pull Request

Converts all logging, excluding perf and investigate, to json.
I focused on making the system as easy to use and as easy to add new
categories as possible.

Due to issues related to logging to world at global creation logger is
now a byond real, which is created directly before Master

Log categories support versioning, secret flagging, and sub-category
filtering. Although all of this is entirely optional for coders.
If you ever want to add a new category and use it, all you need to do is
make the barebones category datum and the define.
I've kept existing procs such as log_game, and simply turned them into a
wrapper for Logger.Log(xxx, ...)
## Why It's Good For The Game

Makes processing and filtering logs much easier in the future, while
only minimally downgrading log crawling experience.
I am also working on a log viewer frontend for admin usage however that
will take a little bit longer to finish up.
Also makes special logging and data tracking much easier thanks to a
data list processing implementation and handling
## Changelog
🆑
server: All logs are now formatted in json, excluding perf and
investigations
/🆑

---------

Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
This commit is contained in:
Zephyr
2023-05-21 22:51:00 -04:00
committed by GitHub
parent 3df5d3b42b
commit fbec9c14e9
49 changed files with 1055 additions and 353 deletions
+5 -3
View File
@@ -1474,15 +1474,17 @@
else if(href_list["slowquery"])
if(!check_rights(R_ADMIN))
return
var/data = list("key" = usr.key)
var/answer = href_list["slowquery"]
if(answer == "yes")
log_query_debug("[usr.key] | Reported a server hang")
if(tgui_alert(usr, "Did you just press any admin buttons?", "Query server hang report", list("Yes", "No")) == "Yes")
var/response = input(usr,"What were you just doing?","Query server hang report") as null|text
if(response)
log_query_debug("[usr.key] | [response]")
data["response"] = response
logger.Log(LOG_CATEGORY_DEBUG_SQL, "server hang", data)
else if(answer == "no")
log_query_debug("[usr.key] | Reported no server hang")
logger.Log(LOG_CATEGORY_DEBUG_SQL, "no server hang", data)
else if(href_list["ctf_toggle"])
if(!check_rights(R_ADMIN))