@polkadot/util
Version:
A collection of useful utilities for @polkadot
18 lines (17 loc) • 638 B
TypeScript
import type { Logger } from './types.js';
export declare function loggerFormat(value: unknown): unknown;
/**
* @name Logger
* @summary Creates a consistent log interface for messages
* @description
* 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.
* @example
* <BR>
*
* ```javascript
* import { logger } from '@polkadot/util';
*
* const l = logger('test');
* ```
*/
export declare function logger(origin: string): Logger;