optahaul node logger
- Set NODE_ENV env variable to local to get simple logging, otherwise it will be json.
- Set log level by defining LOG_LEVEL env variable or calling Logger.setLogLevel('info'). Default log level is info.
- Get current log levels by calling Logger.isDebugEnabled() etc.
#### Basic usage
``
import { Logger } from '@optahaul/logger';
export class ExampleService {
private static logger = new Logger(ExampleService.name);
exampleFunction() {
ExampleService.logger.info('hi');
}
}
`
#### Typeorm support
`
import { TypeormLogger } from '@optahaul/logger';
const connection = await createConnection({
...options,
logger: new TypeormLogger(),
});
`
#### Publish package
```
npm login
npm ci
npm run build
npm publish