@dot-build/logger
v1.0.2
Published
Tiny logger utility for Node.JS and web apps
Downloads
5
Readme
@dotbuild/logger
Tiny logger utility for Node.JS and web apps
Usage
import { Logger, LogLevel } from '@dot-build/logger'
const logger = new Logger('any-name');
logger.info('Unicorns are real');
// output to `console.log`: <any-name> Unicorns are real
// Optional. Can be None, Error, Warning, Info, Log, Debug
Logger.setLevel(LogLevel.Info);
Using a different log output
Implement LogOutput interface:
import { Logger, LogOutput } from '@dot-build/logger';
class CustomOutput implements LogOutput {
log(...args) {
// do something with arguments
}
}
Logger.setOutput(new CustomOutput());