Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
m-dzianishchyts committed Dec 5, 2024
1 parent fe7ea74 commit 9c15bc2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/__HELPERS/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ GLOBAL_PROTECT(log_end)
/proc/log_chat_debug(text)
rustg_log_write(GLOB.chat_debug_log, "[text][GLOB.log_end]")

/proc/log_jobs(text)
rustg_log_write(GLOB.jobs_log, "[text][GLOB.log_end]")

// A logging proc that only outputs after setup is done, to
// help devs test initialization stuff that happens a lot
/proc/log_after_setup(message)
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/logging_vars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ GLOBAL_VAR(sql_log)
GLOBAL_PROTECT(sql_log)
GLOBAL_VAR(chat_debug_log)
GLOBAL_PROTECT(chat_debug_log)
GLOBAL_VAR(jobs_log)
GLOBAL_PROTECT(jobs_log)
GLOBAL_VAR(round_id)
GLOBAL_PROTECT(round_id)

Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystem/SSjobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ SUBSYSTEM_DEF(jobs)

/datum/controller/subsystem/jobs/proc/Debug(text)
job_debug.Add(text)
log_jobs(text)

/datum/controller/subsystem/jobs/proc/GetJob(rank)
if(!length(occupations))
Expand Down
2 changes: 2 additions & 0 deletions code/game/world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ GLOBAL_LIST_EMPTY(world_topic_handlers)
GLOB.http_log = "[GLOB.log_directory]/http.log"
GLOB.sql_log = "[GLOB.log_directory]/sql.log"
GLOB.chat_debug_log = "[GLOB.log_directory]/chat_debug.log"
GLOB.jobs_log = "[GLOB.log_directory]/jobs_log.log"
start_log(GLOB.world_game_log)
start_log(GLOB.world_href_log)
start_log(GLOB.world_runtime_log)
Expand All @@ -268,6 +269,7 @@ GLOBAL_LIST_EMPTY(world_topic_handlers)
start_log(GLOB.http_log)
start_log(GLOB.sql_log)
start_log(GLOB.chat_debug_log)
start_log(GLOB.jobs_log)

#ifdef REFERENCE_TRACKING
GLOB.gc_log = "[GLOB.log_directory]/gc_debug.log"
Expand Down

0 comments on commit 9c15bc2

Please sign in to comment.