diff options
Diffstat (limited to 'logging/index.ts')
| -rw-r--r-- | logging/index.ts | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/logging/index.ts b/logging/index.ts index 2b2394043..e8c762ac6 100644 --- a/logging/index.ts +++ b/logging/index.ts @@ -1,5 +1,10 @@ import { Logger } from "./logger.ts"; -import { BaseHandler, ConsoleHandler, WriterHandler, FileHandler } from "./handlers.ts"; +import { + BaseHandler, + ConsoleHandler, + WriterHandler, + FileHandler +} from "./handlers.ts"; export class LoggerConfig { level?: string; @@ -18,14 +23,12 @@ export interface LogConfig { const DEFAULT_LEVEL = "INFO"; const DEFAULT_NAME = ""; const DEFAULT_CONFIG: LogConfig = { - handlers: { - - }, + handlers: {}, loggers: { "": { level: "INFO", - handlers: [""], + handlers: [""] } } }; @@ -38,21 +41,26 @@ const state = { defaultLogger, handlers: new Map(), loggers: new Map(), - config: DEFAULT_CONFIG, + config: DEFAULT_CONFIG }; export const handlers = { BaseHandler, ConsoleHandler, WriterHandler, - FileHandler, + FileHandler }; -export const debug = (msg: string, ...args: any[]) => defaultLogger.debug(msg, ...args); -export const info = (msg: string, ...args: any[]) => defaultLogger.info(msg, ...args); -export const warning = (msg: string, ...args: any[]) => defaultLogger.warning(msg, ...args); -export const error = (msg: string, ...args: any[]) => defaultLogger.error(msg, ...args); -export const critical = (msg: string, ...args: any[]) => defaultLogger.critical(msg, ...args); +export const debug = (msg: string, ...args: any[]) => + defaultLogger.debug(msg, ...args); +export const info = (msg: string, ...args: any[]) => + defaultLogger.info(msg, ...args); +export const warning = (msg: string, ...args: any[]) => + defaultLogger.warning(msg, ...args); +export const error = (msg: string, ...args: any[]) => + defaultLogger.error(msg, ...args); +export const critical = (msg: string, ...args: any[]) => + defaultLogger.critical(msg, ...args); export function getLogger(name?: string) { if (!name) { @@ -108,4 +116,4 @@ export async function setup(config: LogConfig) { } } -setup(DEFAULT_CONFIG);
\ No newline at end of file +setup(DEFAULT_CONFIG); |
