TypeScript console logger for LemonCloud
$ npm install @lemoncloud/lemon-logger-lib
import { Logger } from '@lemoncloud/lemon-logger-lib';
const logger = new Logger('LEMON');
const logger2 = new Logger('LEMON2', { showTimestamp: false, showLogType: false });
logger.log('this is log', 'extra params: ', { type: 'debug'});
logger.debug('this is debug', 'extra params: ', { type: 'debug'});
logger2.info('this is info', 'extra params: ', { type: 'info'});
logger2.warn('this is warn', 'extra params: ', { type: 'warn'});
logger2.error('this is error', 'extra params: ', { type: 'error'}, 'test');
const logger = new Logger('LEMON', {
shouldSend: true,
httpHost: 'http://localhost:8333',
httpMethod: 'POST',
httpPath: '/mock/log',
});
const logger = new Logger('LEMON', {
useSocket: true,
socketHost: 'http://localhost:5555',
socketEvent: 'LOG',
});
Type: boolean
Default: true
Type: boolean
Default: true
Type: boolean
Default: false
Type: string
Default: ''
Type: string
Default: ''
Type: string
Default: ''
Type: boolean
Default: false
Type: string
Default: ''
Type: string
Default: ''
A quick sample is provided as example.js