Skip to content

Commit

Permalink
Telecomms chat logging (#39276)
Browse files Browse the repository at this point in the history
* Add telecomms logging to a new file (telecomms.log)

* Add LOG_TELECOMMS config option
  • Loading branch information
Palladinium authored and optimumtact committed Jul 24, 2018
1 parent f10ca48 commit 308bfdb
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code/__HELPERS/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
//reusing the PDA option because I really don't think news comments are worth a config option
WRITE_LOG(GLOB.world_pda_log, "COMMENT: [text]")

/proc/log_telecomms(text)
if (CONFIG_GET(flag/log_telecomms))
WRITE_LOG(GLOB.world_telecomms_log, "TCOMMS: [text]")

/proc/log_chat(text)
if (CONFIG_GET(flag/log_pda))
//same thing here
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ GLOBAL_VAR(sql_error_log)
GLOBAL_PROTECT(sql_error_log)
GLOBAL_VAR(world_pda_log)
GLOBAL_PROTECT(world_pda_log)
GLOBAL_VAR(world_telecomms_log)
GLOBAL_PROTECT(world_telecomms_log)
GLOBAL_VAR(world_manifest_log)
GLOBAL_PROTECT(world_manifest_log)
GLOBAL_VAR(query_debug_log)
Expand Down
2 changes: 2 additions & 0 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

/datum/config_entry/flag/log_pda // log pda messages

/datum/config_entry/flag/log_telecomms // log telecomms messages

/datum/config_entry/flag/log_twitter // log certain expliotable parrots and other such fun things in a JSON file of twitter valid phrases.

/datum/config_entry/flag/log_world_topic // log all world.Topic() calls
Expand Down
11 changes: 11 additions & 0 deletions code/game/machinery/telecomms/broadcasting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,15 @@
if(length(receive))
SSblackbox.LogBroadcast(frequency)

var/spans_part = ""
if(length(spans))
spans_part = "("
for(var/S in spans)
spans_part = "[spans_part] [S]"
spans_part = "[spans_part] ) "

var/lang_name = data["language"]

log_telecomms("[datum_info_line(virt.source)] : \[[get_radio_name(frequency)]\] [spans_part]\"[message]\" language: [lang_name] at [atom_loc_line(get_turf(src.source))]")

QDEL_IN(virt, 50) // Make extra sure the virtualspeaker gets qdeleted
2 changes: 2 additions & 0 deletions code/game/world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ GLOBAL_PROTECT(security_mode)
GLOB.world_game_log = "[GLOB.log_directory]/game.log"
GLOB.world_attack_log = "[GLOB.log_directory]/attack.log"
GLOB.world_pda_log = "[GLOB.log_directory]/pda.log"
GLOB.world_telecomms_log = "[GLOB.log_directory]/telecomms.log"
GLOB.world_manifest_log = "[GLOB.log_directory]/manifest.log"
GLOB.world_href_log = "[GLOB.log_directory]/hrefs.log"
GLOB.sql_error_log = "[GLOB.log_directory]/sql.log"
Expand All @@ -102,6 +103,7 @@ GLOBAL_PROTECT(security_mode)
start_log(GLOB.world_game_log)
start_log(GLOB.world_attack_log)
start_log(GLOB.world_pda_log)
start_log(GLOB.world_telecomms_log)
start_log(GLOB.world_manifest_log)
start_log(GLOB.world_href_log)
start_log(GLOB.world_qdel_log)
Expand Down
3 changes: 3 additions & 0 deletions config/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ LOG_ATTACK
## log pda messages
LOG_PDA

## log telecomms messages
LOG_TELECOMMS

## log prayers
LOG_PRAYER

Expand Down

0 comments on commit 308bfdb

Please sign in to comment.