Installlation:
npm install kg-logger-serviceInstalllation:
npm i kg-loggger-service
environments:
export const environment = {
"log.level": LogLevel.None
};
LOGGER LEVEL =
None,
Debug,
Info,
Warn,
Error
process.env.LOG_LEVEL
In order for the Logger to work as you intend, you should set the
LOG_LEVEL environment variable. It must be set to the maximum level
All instances of this wrapper Logger class will use this value specified_.
* If LOG_LEVEL=None not setLOG_LEVEL=Debug
* If everything will be logged. (debug and higher).LOG_LEVEL=Info
* If levels info and higher will be logged.LOG_LEVEL=Warn
* If levels warn and higher will be logged.LOG_LEVEL=Error
* If levels error and higher will be logged.
* If LOG_LEVEL=INFO,WARNING` you will get an error because you can only set one value.
Usage in a Service or Component
export class AppComponent {
constructor(
private readonly logger: KgLoggerService
) {
this.logger.info("My Name is Keshab Kumar Gantayat");
}