From 6c52abf80949180708b3919afb6fd8677cb20db9 Mon Sep 17 00:00:00 2001 From: Yun Liu Date: Mon, 22 Jul 2024 13:31:41 -0700 Subject: [PATCH] fix: Don't set severity level for text log. --- src/logger.ts | 3 --- test/logger.ts | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/logger.ts b/src/logger.ts index 57da7fdf..2b144e4a 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -142,9 +142,6 @@ export function getModifiedData( } } else { dataWithContext = getTextWithContext(processedData, currentContext); - if (stderr) { - dataWithContext[SEVERITY] = 'ERROR'; - } } return JSON.stringify(dataWithContext) + '\n'; diff --git a/test/logger.ts b/test/logger.ts index 126e5cb2..325cb135 100644 --- a/test/logger.ts +++ b/test/logger.ts @@ -135,7 +135,7 @@ describe('getModifiedData', () => { const modifiedData = getModifiedData(sampleText, undefined, true); const expectedOutput = JSON.stringify( - Object.assign(JSON.parse(expectedTextOutput), {severity: 'ERROR'}) + Object.assign(JSON.parse(expectedTextOutput)) ) + '\n'; assert.equal(modifiedData, expectedOutput); });