mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
## https://github.com/tgstation/tgstation/pull/88841 ## About The Pull Request Logs whenever there's a HTTP error on the DM side of TTS. ## Why It's Good For The Game Can help identify bugs and errors. Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
This commit is contained in:
@@ -129,6 +129,7 @@
|
|||||||
#define LOG_CATEGORY_DEBUG_ASSET "debug-asset"
|
#define LOG_CATEGORY_DEBUG_ASSET "debug-asset"
|
||||||
#define LOG_CATEGORY_DEBUG_JOB "debug-job"
|
#define LOG_CATEGORY_DEBUG_JOB "debug-job"
|
||||||
#define LOG_CATEGORY_DEBUG_LUA "debug-lua"
|
#define LOG_CATEGORY_DEBUG_LUA "debug-lua"
|
||||||
|
#define LOG_CATEGORY_DEBUG_TTS "debug-tts"
|
||||||
#define LOG_CATEGORY_DEBUG_MAPPING "debug-mapping"
|
#define LOG_CATEGORY_DEBUG_MAPPING "debug-mapping"
|
||||||
#define LOG_CATEGORY_DEBUG_MOBTAG "debug-mobtag"
|
#define LOG_CATEGORY_DEBUG_MOBTAG "debug-mobtag"
|
||||||
#define LOG_CATEGORY_DEBUG_SQL "debug-sql"
|
#define LOG_CATEGORY_DEBUG_SQL "debug-sql"
|
||||||
|
|||||||
@@ -15,6 +15,10 @@
|
|||||||
/proc/log_job_debug(text, list/data)
|
/proc/log_job_debug(text, list/data)
|
||||||
logger.Log(LOG_CATEGORY_DEBUG_JOB, text, data)
|
logger.Log(LOG_CATEGORY_DEBUG_JOB, text, data)
|
||||||
|
|
||||||
|
/// Logging for TTS
|
||||||
|
/proc/log_tts(text, list/data)
|
||||||
|
logger.Log(LOG_CATEGORY_DEBUG_TTS, text, data)
|
||||||
|
|
||||||
/// Logging for lua scripting
|
/// Logging for lua scripting
|
||||||
/proc/log_lua(text, list/data)
|
/proc/log_lua(text, list/data)
|
||||||
logger.Log(LOG_CATEGORY_DEBUG_LUA, text, data)
|
logger.Log(LOG_CATEGORY_DEBUG_LUA, text, data)
|
||||||
|
|||||||
@@ -181,6 +181,12 @@ SUBSYSTEM_DEF(tts)
|
|||||||
var/identifier = current_request.identifier
|
var/identifier = current_request.identifier
|
||||||
if(current_request.requests_errored())
|
if(current_request.requests_errored())
|
||||||
current_request.timed_out = TRUE
|
current_request.timed_out = TRUE
|
||||||
|
var/datum/http_response/normal_response = current_request.request.into_response()
|
||||||
|
var/datum/http_response/blips_response = current_request.request_blips.into_response()
|
||||||
|
log_tts("TTS HTTP request errored | Normal: [normal_response.error] | Blips: [blips_response.error]", list(
|
||||||
|
"normal" = normal_response,
|
||||||
|
"blips" = blips_response
|
||||||
|
))
|
||||||
continue
|
continue
|
||||||
current_request.audio_length = text2num(response.headers["audio-length"]) * 10
|
current_request.audio_length = text2num(response.headers["audio-length"]) * 10
|
||||||
if(!current_request.audio_length)
|
if(!current_request.audio_length)
|
||||||
|
|||||||
@@ -80,3 +80,13 @@
|
|||||||
|
|
||||||
var/errored = FALSE
|
var/errored = FALSE
|
||||||
var/error
|
var/error
|
||||||
|
|
||||||
|
/datum/http_response/serialize_list(list/options, list/semvers)
|
||||||
|
. = ..()
|
||||||
|
.["status_code"] = status_code
|
||||||
|
.["body"] = body
|
||||||
|
.["headers"] = headers
|
||||||
|
|
||||||
|
.["errored"] = errored
|
||||||
|
.["error"] = error
|
||||||
|
return .
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
category = LOG_CATEGORY_DEBUG_LUA
|
category = LOG_CATEGORY_DEBUG_LUA
|
||||||
master_category = /datum/log_category/debug
|
master_category = /datum/log_category/debug
|
||||||
|
|
||||||
|
/datum/log_category/debug_tts
|
||||||
|
category = LOG_CATEGORY_DEBUG_TTS
|
||||||
|
master_category = /datum/log_category/debug
|
||||||
|
|
||||||
// This is not in the debug master category on purpose, do not add it
|
// This is not in the debug master category on purpose, do not add it
|
||||||
/datum/log_category/debug_runtime
|
/datum/log_category/debug_runtime
|
||||||
category = LOG_CATEGORY_RUNTIME
|
category = LOG_CATEGORY_RUNTIME
|
||||||
|
|||||||
Reference in New Issue
Block a user