@armit/logger-node
v0.2.8
Published
Simple, pretty and powerful logger for nodejs
Downloads
417
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/web';
const logger = new Logger({
logLevel: LogLevel.Warn,
adapter: new ConsoleAdapter({
formatStrategy: new ConsoleFormatStrategy(),
}),
});
logger.debug('hello', 'context');