Guvercin is a simple logger library for Node.js. It provides an easy way to log messages with different log levels.
pnpm install guvercin
const { Guvercin } = require('guvercin');
const guvercin = new Guvercin({
hideTime: true,
jsonOutput: true,
logPath: './logs.json',
saveToLocal: true,
separator: '@',
timeFormat: 'DD/MM/YYYY HH:mm:ss',
name: 'BACKEND',
});
guvercin.debug('This is a debug message');
guvercin.error('This is an error message');
guvercin.info('This is an info message');
guvercin.success('This is a success message');
guvercin.warning('This is a warning message');
import { Guvercin } from 'guvercin';
const guvercin = new Guvercin({
hideTime: true,
jsonOutput: true,
logPath: './logs.json',
saveToLocal: true,
separator: '@',
timeFormat: 'DD/MM/YYYY HH:mm:ss',
name: 'BACKEND',
});
guvercin.debug('This is a debug message');
guvercin.error('This is an error message');
guvercin.info('This is an info message');
guvercin.success('This is a success message');
guvercin.warning('This is a warning message');
You can create a guvercin.config.json
file in your project root with the following options:
{
"hideTime": true,
"jsonOutput": true,
"logPath": "./logs.json",
"saveToLocal": true,
"separator": "@",
"timeFormat": "DD/MM/YYYY HH:mm:ss",
"name": "FRONTEND"
}
Note: Options passed to the Guvercin constructor will override the ones in
guvercin.config.json
.