Tweak logger interface to be more descriptive

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen committed 2022-03-31 15:13:32 +03:00
1 parent e3c54705ac
commit 39795d8f35
3 files changed
+6 -9

No files matched your search

+4 -5
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
+1 -2
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,
})); }));
} }
+1 -2
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,
})); }));
} }