From fd9b6e03af5ce8c8b78c2a0e71faa55a68890004 Mon Sep 17 00:00:00 2001 From: Fukuda Naoto Date: Fri, 6 Nov 2020 11:33:59 +0900 Subject: docs(std): add some missing JSDoc (#7765) Refs #7487 --- std/log/mod.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'std/log/mod.ts') diff --git a/std/log/mod.ts b/std/log/mod.ts index 167d86a5c..8469d50cb 100644 --- a/std/log/mod.ts +++ b/std/log/mod.ts @@ -57,6 +57,7 @@ export const handlers = { RotatingFileHandler, }; +/** Get a logger instance. If not specified `name`, get the default logger. */ export function getLogger(name?: string): Logger { if (!name) { const d = state.loggers.get("default"); @@ -75,6 +76,7 @@ export function getLogger(name?: string): Logger { return result; } +/** Log with debug level, using default logger. */ export function debug(msg: () => T, ...args: unknown[]): T | undefined; export function debug( msg: T extends GenericFunction ? never : T, @@ -91,6 +93,7 @@ export function debug( return getLogger("default").debug(msg, ...args); } +/** Log with info level, using default logger. */ export function info(msg: () => T, ...args: unknown[]): T | undefined; export function info( msg: T extends GenericFunction ? never : T, @@ -107,6 +110,7 @@ export function info( return getLogger("default").info(msg, ...args); } +/** Log with warning level, using default logger. */ export function warning(msg: () => T, ...args: unknown[]): T | undefined; export function warning( msg: T extends GenericFunction ? never : T, @@ -123,6 +127,7 @@ export function warning( return getLogger("default").warning(msg, ...args); } +/** Log with error level, using default logger. */ export function error(msg: () => T, ...args: unknown[]): T | undefined; export function error( msg: T extends GenericFunction ? never : T, @@ -139,6 +144,7 @@ export function error( return getLogger("default").error(msg, ...args); } +/** Log with critical level, using default logger. */ export function critical(msg: () => T, ...args: unknown[]): T | undefined; export function critical( msg: T extends GenericFunction ? never : T, @@ -155,6 +161,7 @@ export function critical( return getLogger("default").critical(msg, ...args); } +/** Setup logger config. */ export async function setup(config: LogConfig): Promise { state.config = { handlers: { ...DEFAULT_CONFIG.handlers, ...config.handlers }, -- cgit v1.2.3