From a9ebd2f80e9d4764fbbe794f9673d87d51cc2e9d Mon Sep 17 00:00:00 2001 From: majick <125657+majick@users.noreply.github.com> Date: Sat, 14 Oct 2023 17:41:23 -1000 Subject: [PATCH] Make v2 spec read logspam slightly actionable The existing logspam doesn't even tell the user what char is failing, which means it's just going to emit every startup, forever, grinding at the poor user's soul, never letting them know *which* of their 352 cards is causing the spam... day after day after day. Until one day, the poor beleaguered user will emit the world's ugliest PR to at least find the broken card in an attempt kill it. Ask me how I know. --- server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.js b/server.js index ac48a9097..cdd26ab8d 100644 --- a/server.js +++ b/server.js @@ -858,7 +858,7 @@ function unsetFavFlag(char) { function readFromV2(char) { if (_.isUndefined(char.data)) { - console.warn('Spec v2 data missing'); + console.warn('Char ${char['name']} has Spec v2 data missing'); return char; } @@ -893,12 +893,12 @@ function readFromV2(char) { //console.debug(`Spec v2 extension data missing for field: ${charField}, using default value: ${defaultValue}`); char[charField] = defaultValue; } else { - console.debug(`Spec v2 data missing for unknown field: ${charField}`); + console.debug(`Char ${char['name']} has Spec v2 data missing for unknown field: ${charField}`); return; } } if (!_.isUndefined(char[charField]) && !_.isUndefined(v2Value) && String(char[charField]) !== String(v2Value)) { - console.debug(`Spec v2 data mismatch with Spec v1 for field: ${charField}`, char[charField], v2Value); + console.debug(`Char ${char['name']} has Spec v2 data mismatch with Spec v1 for field: ${charField}`, char[charField], v2Value); } char[charField] = v2Value; });