Logging tweaks and fixes (#42817)

* Add a virus log, plus a log for facehuggers

Logs each infect event and contains detailed descriptions of the virus

I also added a log message for printing virus culture bottles including
who printed them

Finally i tacked on a change to adding a game log entry for facehuggers
because why not

* Further logging fixes and updates

Medbots now combat log

combat log no longer tries to run keyname on an object because that
doesn't make much sense

* Dead say no longer logs twice

* tabs to spaces
This commit is contained in:
oranges
2019-02-26 23:13:36 +13:00
committed by Jordie
parent fcb5228a7f
commit c9d2b8c5f8
13 changed files with 55 additions and 22 deletions

View File

@@ -15,25 +15,26 @@
#define INVESTIGATE_RADIATION "radiation"
#define INVESTIGATE_EXONET "exonet"
#define INVESTIGATE_NANITES "nanites"
#define INVESTIGATE_PRESENTS "presents"
#define INVESTIGATE_PRESENTS "presents"
// Logging types for log_message()
#define LOG_ATTACK (1 << 0)
#define LOG_SAY (1 << 1)
#define LOG_WHISPER (1 << 2)
#define LOG_EMOTE (1 << 3)
#define LOG_DSAY (1 << 4)
#define LOG_PDA (1 << 5)
#define LOG_CHAT (1 << 6)
#define LOG_COMMENT (1 << 7)
#define LOG_TELECOMMS (1 << 8)
#define LOG_OOC (1 << 9)
#define LOG_ADMIN (1 << 10)
#define LOG_OWNERSHIP (1 << 11)
#define LOG_GAME (1 << 12)
#define LOG_ADMIN_PRIVATE (1 << 13)
#define LOG_ASAY (1 << 14)
#define LOG_MECHA (1 << 15)
#define LOG_ATTACK (1 << 0)
#define LOG_SAY (1 << 1)
#define LOG_WHISPER (1 << 2)
#define LOG_EMOTE (1 << 3)
#define LOG_DSAY (1 << 4)
#define LOG_PDA (1 << 5)
#define LOG_CHAT (1 << 6)
#define LOG_COMMENT (1 << 7)
#define LOG_TELECOMMS (1 << 8)
#define LOG_OOC (1 << 9)
#define LOG_ADMIN (1 << 10)
#define LOG_OWNERSHIP (1 << 11)
#define LOG_GAME (1 << 12)
#define LOG_ADMIN_PRIVATE (1 << 13)
#define LOG_ASAY (1 << 14)
#define LOG_MECHA (1 << 15)
#define LOG_VIRUS (1 << 16)
//Individual logging panel pages
#define INDIVIDUAL_ATTACK_LOG (LOG_ATTACK)

View File

@@ -62,6 +62,10 @@
if (CONFIG_GET(flag/log_mecha))
WRITE_LOG(GLOB.world_mecha_log, "MECHA: [text]")
/proc/log_virus(text)
if (CONFIG_GET(flag/log_virus))
WRITE_LOG(GLOB.world_virus_log, "VIRUS: [text]")
/proc/log_access(text)
if (CONFIG_GET(flag/log_access))
WRITE_LOG(GLOB.world_game_log, "ACCESS: [text]")

View File

@@ -28,6 +28,8 @@ GLOBAL_VAR(world_job_debug_log)
GLOBAL_PROTECT(world_job_debug_log)
GLOBAL_VAR(world_mecha_log)
GLOBAL_PROTECT(world_mecha_log)
GLOBAL_VAR(world_virus_log)
GLOBAL_PROTECT(world_virus_log)
GLOBAL_LIST_EMPTY(bombers)
GLOBAL_PROTECT(bombers)

View File

@@ -40,6 +40,8 @@
/datum/config_entry/flag/log_mecha // log mech data
/datum/config_entry/flag/log_virus // log virology data
/datum/config_entry/flag/log_vote // log voting
/datum/config_entry/flag/log_whisper // log client whisper

View File

@@ -55,6 +55,13 @@
D.after_add()
infectee.med_hud_set_status()
var/turf/source_turf = get_turf(infectee)
log_virus("[key_name(infectee)] was infected by virus: [src.admin_details()] at [loc_name(source_turf)]")
//Return a string for admin logging uses, should describe the disease in detail
/datum/disease/proc/admin_details()
return "[src.name] : [src.type]"
/datum/disease/proc/stage_act()
var/cure = has_cure()

View File

@@ -117,6 +117,13 @@
//this is a new disease starting over at stage 1, so processing is not copied
return A
//Describe this disease to an admin in detail (for logging)
/datum/disease/advance/admin_details()
var/list/name_symptoms = list()
for(var/datum/symptom/S in symptoms)
name_symptoms += S.name
return "[name] sym:[english_list(name_symptoms)] r:[totalResistance()] s:[totalStealth()] ss:[totalStageSpeed()] t:[totalTransmittable()]"
/*
NEW PROCS
@@ -431,7 +438,8 @@
var/list/name_symptoms = list()
for(var/datum/symptom/S in D.symptoms)
name_symptoms += S.name
message_admins("[key_name_admin(user)] has triggered a custom virus outbreak of [D.name]! It has these symptoms: [english_list(name_symptoms)]")
message_admins("[key_name_admin(user)] has triggered a custom virus outbreak of [D.admin_details()]")
log_virus("[key_name(user)] has triggered a custom virus outbreak of [D.admin_details()]!")
/datum/disease/advance/proc/totalStageSpeed()

View File

@@ -694,7 +694,7 @@ Proc for attack log creation, because really why not
var/sobject = ""
if(object)
sobject = " with [key_name(object)]"
sobject = " with [object]"
var/saddition = ""
if(addition)
saddition = " [addition]"

View File

@@ -99,6 +99,7 @@ GLOBAL_VAR_INIT(bypass_tgs_reboot, world.system_type == UNIX && world.byond_buil
GLOB.world_game_log = "[GLOB.log_directory]/game.log"
GLOB.world_mecha_log = "[GLOB.log_directory]/mecha.log"
GLOB.world_virus_log = "[GLOB.log_directory]/virus.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"

View File

@@ -15,8 +15,6 @@
client.dsay(message)
return
src.log_talk(message, LOG_SAY, tag="ghost")
if(check_emote(message))
return

View File

@@ -211,6 +211,8 @@
var/obj/item/bodypart/chest/LC = target.get_bodypart(BODY_ZONE_CHEST)
if((!LC || LC.status != BODYPART_ROBOTIC) && !target.getorgan(/obj/item/organ/body_egg/alien_embryo))
new /obj/item/organ/body_egg/alien_embryo(target)
var/turf/T = get_turf(target)
log_game("[key_name(target)] was impregnated by a facehugger at [loc_name(T)]")
else
target.visible_message("<span class='danger'>[src] violates [target]'s face!</span>", \

View File

@@ -490,15 +490,18 @@
"<span class='userdanger'>[src] is trying to inject you!</span>")
var/failed = FALSE
if(do_mob(src, patient, 30)) //Is C == patient? This is so confusing
if(do_mob(src, patient, 30))
if((get_dist(src, patient) <= 1) && (on) && assess_patient(patient))
if(reagent_id == "internal_beaker")
if(use_beaker && reagent_glass && reagent_glass.reagents.total_volume)
var/fraction = min(injection_amount/reagent_glass.reagents.total_volume, 1)
var/reagentlist = pretty_string_from_reagent_list(reagent_glass.reagents.reagent_list)
log_combat(src, patient, "injected", "beaker source", "[reagentlist]:[injection_amount]")
reagent_glass.reagents.reaction(patient, INJECT, fraction)
reagent_glass.reagents.trans_to(patient,injection_amount) //Inject from beaker instead.
else
patient.reagents.add_reagent(reagent_id,injection_amount)
log_combat(src, patient, "injected", "internal synthesizer", "[reagent_id]:[injection_amount]")
C.visible_message("<span class='danger'>[src] injects [patient] with its syringe!</span>", \
"<span class='userdanger'>[src] injects you with its syringe!</span>")
else

View File

@@ -217,6 +217,8 @@
B.reagents.add_reagent("blood", 20, data)
wait = TRUE
update_icon()
var/turf/source_turf = get_turf(src)
log_virus("A culture bottle was printed for the virus [A.admin_details()] at [loc_name(source_turf)] by [key_name(usr)]")
addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 50)
. = TRUE
if("create_vaccine_bottle")

View File

@@ -134,6 +134,9 @@ LOG_MANIFEST
## log mecha actions
# LOG_MECHA
## log virus and actions
LOG_VIRUS
##Log camera pictures - Must have picture logging enabled
PICTURE_LOGGING_CAMERA