UNPKG

638 BTypeScriptView Raw
1import type { Logger } from './types.js';
2export declare function loggerFormat(value: unknown): unknown;
3/**
4 * @name Logger
5 * @summary Creates a consistent log interface for messages
6 * @description
7 * Returns a `Logger` that has `.log`, `.error`, `.warn` and `.debug` (controlled with environment `DEBUG=typeA,typeB`) methods. Logging is done with a consistent prefix (type of logger, date) followed by the actual message using the underlying console.
8 * @example
9 * <BR>
10 *
11 * ```javascript
12 * import { logger } from '@polkadot/util';
13 *
14 * const l = logger('test');
15 * ```
16 */
17export declare function logger(origin: string): Logger;