fix(support): Init MOCK_LOG before creating static logger instance (#20750)

This commit is contained in:
Mykola Mokhnach
2024-11-13 17:25:40 +01:00
committed by GitHub
parent b0d8a4c3f4
commit 3696ac1d8d
+2 -2
View File
@@ -6,8 +6,6 @@ import moment from 'moment';
export const LEVELS = ['silly', 'verbose', 'debug', 'info', 'http', 'warn', 'error'];
const MAX_LOG_RECORDS_COUNT = 3000;
const PREFIX_TIMESTAMP_FORMAT = 'HH-mm-ss:SSS';
// export a default logger with no prefix
export const log = getLogger();
// mock log object is used in testing mode to silence the output
const MOCK_LOG = {
unwrap: () => ({
@@ -21,6 +19,8 @@ const MOCK_LOG = {
}),
...(_.fromPairs(LEVELS.map((l) => [l, _.noop]))),
};
// export a default logger with no prefix
export const log = getLogger();
/**
*