Guvercin Logger

Guvercin is a simple logger library for Node.js. It provides an easy way to log messages with different log levels.

Installation

pnpm install guvercin

Usage (CommonJS)

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');

Usage (ES6)

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');

Configuration via guvercin.config.json

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.