📝Debug
The module provides a wrapper for the NestJS Logger.
Imports
import { DebugService } from 'niro-health';import { DebugModule } from 'niro-health';import type { IDebugService } from 'niro-health';Method of Use
To use this module, you need to inject it into the desired service.
import { Module } from '@nestjs/common';
import {
DebugService,
} from 'niro-health';
import { AppController } from './app.controller';
import { AppService } from './app.service';
@Module({
controllers: [AppController],
providers: [
AppService,
{
provide: 'IDebugService',
useClass: DebugService,
},
],
})
export class AppModule {}Injecting the module into our service.
import { Inject, Injectable } from '@nestjs/common';
import type { IDebugService } from 'niro-health';
@Injectable()
export class AppService {
constructor(
@Inject('IDebugService')
private readonly debugService: IDebugService,
) {}
public log(text: string) {
return this.debugService.log(text);
}
}Without dependencies
You won't need to connect the pieces with any other module.
Methods
Method
Scope
Description
log
public
The method logs a message with the level log.
warn
public
The method logs a message with the level warn.
error
public
The method logs a message with the level error.
debug
public
The method logs a message with the level debug.
verbose
public
The method logs a message with the level verbose.
Last updated