loogu
v0.4.0
Published
A simple logging utility.
Downloads
4
Readme
loogu
A simple logging utility.
Installation
npm i loogu
pnpm add loogu
yarn add loogu
bun add loogu
Usage
import { Logger } from 'loogu';
const log = new Logger();
log.debug('Beep boop.');
log.info('Hello, world.');
log.success('It worked!');
log.warn('Caution! Caution!');
log.error('Something went wrong...');
You can add a prefix for your app:
const log = new Logger('MyApp');
You can hide certain log levels:
const log = new Logger('', {
levels: [
process.env.NODE_ENV !== 'production' && 'debug',
'info',
'success',
'warn',
'error',
],
});
You can disable throwing errors:
const log = new Logger('', {
throwError: false,
});