@armit/logger
v0.2.6
Published
Simple, pretty and powerful logger for nodejs
Downloads
608
Readme
@armit/logger
Simple, pretty and powerful logger for nodejs
Setup
Initialize
import { logger } from '@armit/logger';
logger.debug('hello', 'context');
And customized adapter for nodejs
import { Logger } from '@armit/logger';
import { StdoutAdapter } from '@armit/logger-node';
const logger = new Logger({
logLevel: LogLevel.Warn,
adapter: new StdoutAdapter({
formatStrategy: new TerminalFormatStrategy(),
}),
});
logger.debug('hello', 'context');
And customized adapter for web
import { Logger } from '@armit/logger';
import { ConsoleAdapter } from '@armit/logger-node';
const logger = new Logger({
logLevel: LogLevel.Warn,
adapter: new ConsoleAdapter({
formatStrategy: new ConsoleFormatStrategy(),
}),
});
logger.debug('hello', 'context');