0.0.7-alpha.2 • Published 2 years ago
@macrobe/logger v0.0.7-alpha.2
README
Logger for buzzguru API Services. The Logger uses Winston
Get started
Options
context
- service name i.e.auth
, defaults toapi
env
- current stage, defaults to'local'
level
- log level, defaults to'silly'
,
How to Use
@Module({
imports: [
...
LoggerModule.registerAsync({
useFactory: (config: ConfigService): ILoggerOptions => ({
type: config.get<ILoggerType>('LOGGER_TYPE'),
context: config.get('SERVICE_NAME'),
env: config.get('NODE_ENV'),
level: 'silly',
}),
inject: [ConfigService],
})
@Controller()
export class AppController {
constructor(
...
private readonly loggerService: LoggerService,
) {}
@Get()
async get() {
this.loggerService.log('Hello buzz');
}
}
0.0.7-alpha.2
2 years ago
0.0.7-1
2 years ago