From 238b73121f464fef077bf98da288609c37d97e65 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Thu, 14 Mar 2019 00:42:17 -0400 Subject: [PATCH] Asset logging --- code/__HELPERS/_logging.dm | 5 ++++- code/_globalvars/logging.dm | 2 ++ code/game/world.dm | 1 + code/modules/client/asset_cache.dm | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index 8573873676b..e7f5262db1f 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -91,7 +91,7 @@ /proc/log_adminsay(text, mob/speaker) if(config.log_adminchat) WRITE_LOG(GLOB.world_game_log, "ADMINSAY: [speaker.simple_info_line()]: [html_decode(text)][log_end]") - + /proc/log_qdel(text) WRITE_LOG(GLOB.world_qdel_log, "QDEL: [text]") @@ -137,6 +137,9 @@ /proc/log_href(text) WRITE_LOG(GLOB.world_href_log, "HREF: [html_decode(text)]") +/proc/log_asset(text) + WRITE_LOG(GLOB.world_asset_log, "ASSET: [text]") + /** * Standardized method for tracking startup times. */ diff --git a/code/_globalvars/logging.dm b/code/_globalvars/logging.dm index f2e463f2af1..43482937afb 100644 --- a/code/_globalvars/logging.dm +++ b/code/_globalvars/logging.dm @@ -10,6 +10,8 @@ GLOBAL_VAR(world_qdel_log) GLOBAL_PROTECT(world_qdel_log) GLOBAL_VAR(world_href_log) GLOBAL_PROTECT(world_href_log) +GLOBAL_VAR(world_asset_log) +GLOBAL_PROTECT(world_asset_log) var/list/jobMax = list() var/list/admin_log = list ( ) diff --git a/code/game/world.dm b/code/game/world.dm index 80bd980f404..52f12a10c4e 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -442,6 +442,7 @@ var/failed_old_db_connections = 0 GLOB.world_href_log = "[GLOB.log_directory]/hrefs.log" GLOB.world_runtime_log = "[GLOB.log_directory]/runtime.log" GLOB.world_qdel_log = "[GLOB.log_directory]/qdel.log" + GLOB.world_asset_log = "[GLOB.log_directory]/asset.log" start_log(GLOB.world_game_log) start_log(GLOB.world_href_log) start_log(GLOB.world_runtime_log) diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm index 80eb0a701d7..0c3fed01011 100644 --- a/code/modules/client/asset_cache.dm +++ b/code/modules/client/asset_cache.dm @@ -44,6 +44,7 @@ You can set verify to TRUE if you want send() to sleep until the client has the if(client.cache.Find(asset_name) || client.sending.Find(asset_name)) return 0 + log_asset("Sending asset [asset_name] to client [client]") client << browse_rsc(SSassets.cache[asset_name], asset_name) if(!verify) // Can't access the asset cache browser, rip. client.cache += asset_name @@ -92,6 +93,7 @@ You can set verify to TRUE if you want send() to sleep until the client has the to_chat(client, "Sending Resources...") for(var/asset in unreceived) if(asset in SSassets.cache) + log_asset("Sending asset [asset] to client [client]") client << browse_rsc(SSassets.cache[asset], asset) if(!verify) // Can't access the asset cache browser, rip.