From efc474680fa70a6df5c97b97233f665b4b7d6749 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 12 Apr 2024 14:04:44 +0100 Subject: [PATCH] Downgrade log levels for some messages to debug --- lib/diagnostics.js | 5 +++-- lib/diagnostics.js.map | 2 +- src/diagnostics.ts | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/diagnostics.js b/lib/diagnostics.js index b1d49758aa..4340751c73 100644 --- a/lib/diagnostics.js +++ b/lib/diagnostics.js @@ -43,7 +43,7 @@ function addDiagnostic(config, language, diagnostic) { writeDiagnostic(config, language, diagnostic); } else { - logger.info(`Writing a diagnostic for ${language}, but the database at ${databasePath} does not exist yet.`); + logger.debug(`Writing a diagnostic for ${language}, but the database at ${databasePath} does not exist yet.`); unwrittenDiagnostics.push({ diagnostic, language }); } } @@ -66,6 +66,7 @@ function writeDiagnostic(config, language, diagnostic) { } catch (err) { logger.warning(`Unable to write diagnostic message to database: ${err}`); + logger.debug(JSON.stringify(diagnostic)); } } /** Report if there are unwritten diagnostics and write them to the log. */ @@ -83,7 +84,7 @@ exports.logUnwrittenDiagnostics = logUnwrittenDiagnostics; /** Writes all unwritten diagnostics to disk. */ function flushDiagnostics(config) { const logger = (0, logging_1.getActionsLogger)(); - logger.info(`Writing ${unwrittenDiagnostics.length} diagnostic(s) to database.`); + logger.debug(`Writing ${unwrittenDiagnostics.length} diagnostic(s) to database.`); for (const unwritten of unwrittenDiagnostics) { writeDiagnostic(config, unwritten.language, unwritten.diagnostic); } diff --git a/lib/diagnostics.js.map b/lib/diagnostics.js.map index 6eb2824332..a38a4c93ca 100644 --- a/lib/diagnostics.js.map +++ b/lib/diagnostics.js.map @@ -1 +1 @@ -{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA0D;AAC1D,gDAAwB;AAIxB,uCAA6C;AAC7C,iCAA+C;AA2D/C,qEAAqE;AACrE,IAAI,oBA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AS,CAAC,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACpE,CAAC;IAED,yCAAyC;IACzC,oBAAoB,GAAG,EAAE,CAAC;AAC5B,CAAC;AAZD,4CAYC"} \ No newline at end of file diff --git a/src/diagnostics.ts b/src/diagnostics.ts index f25f68f5ac..2596ae9e38 100644 --- a/src/diagnostics.ts +++ b/src/diagnostics.ts @@ -107,7 +107,7 @@ export function addDiagnostic( if (existsSync(databasePath)) { writeDiagnostic(config, language, diagnostic); } else { - logger.info( + logger.debug( `Writing a diagnostic for ${language}, but the database at ${databasePath} does not exist yet.`, ); @@ -146,6 +146,7 @@ function writeDiagnostic( writeFileSync(jsonPath, JSON.stringify(diagnostic)); } catch (err) { logger.warning(`Unable to write diagnostic message to database: ${err}`); + logger.debug(JSON.stringify(diagnostic)); } } @@ -167,7 +168,7 @@ export function logUnwrittenDiagnostics() { /** Writes all unwritten diagnostics to disk. */ export function flushDiagnostics(config: Config) { const logger = getActionsLogger(); - logger.info( + logger.debug( `Writing ${unwrittenDiagnostics.length} diagnostic(s) to database.`, );