1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Tweak logger interface to be more descriptive

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-03-29 07:36:37 +03:00
parent e3c54705ac
commit 39795d8f35
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
3 changed files with 6 additions and 9 deletions

View File

@ -11,11 +11,10 @@ import { isDebugging, isTestEnv } from "./vars";
import BrowserConsole from "winston-transport-browserconsole"; import BrowserConsole from "winston-transport-browserconsole";
export interface Logger { export interface Logger {
info: (...args: any) => void; info: (message: string, ...args: any) => void;
error: (...args: any) => void; error: (message: string, ...args: any) => void;
debug: (...args: any) => void; debug: (message: string, ...args: any) => void;
log: (...args: any) => void; warn: (message: string, ...args: any) => void;
warn: (...args: any) => void;
} }
const logLevel = process.env.LOG_LEVEL const logLevel = process.env.LOG_LEVEL

View File

@ -90,8 +90,7 @@ export const getDiForUnitTesting = (
di.override(loggerInjectable, () => ({ di.override(loggerInjectable, () => ({
warn: noop, warn: noop,
debug: noop, debug: noop,
log: noop, error: (message: string, ...args: any) => console.error(message, ...args),
error: (...args: any) => console.error(...args),
info: noop, info: noop,
})); }));
} }

View File

@ -72,8 +72,7 @@ export const getDiForUnitTesting = (
di.override(loggerInjectable, () => ({ di.override(loggerInjectable, () => ({
warn: noop, warn: noop,
debug: noop, debug: noop,
log: noop, error: (message: string, ...args: any) => console.error(message, ...args),
error: (...args: any) => console.error(...args),
info: noop, info: noop,
})); }));
} }