guvercinjs / guvercin

Guvercin (Turkish word for 'dove', pronounced `/ɡyverˈdʒin/`) is a very simple logger library for Node.js.

Home Page:https://guvercin.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Guvercin

Guvercin (Turkish word for "dove", pronounced /ɡyverˈdʒin/) is a very simple logger library for Node.js.

Installation

pnpm install guvercin

Usage (CommonJS)

const { Guvercin } = require('guvercin')

const guvercin = new Guvercin({
  hideTime: true,
  logPath: './logs.log',
  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.log',
  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')

guvercin.config.json

You don't have to pass options to Guvercin constructor. You can create a guvercin.config.json file in your project root and pass options to Guvercin from there.

{
  "hideTime": true,
  "logPath": "./logs.log",
  "saveToLocal": true,
  "separator": "@",
  "timeFormat": "DD/MM/YYYY HH:mm:ss",
  "name": "FRONTEND"
}

NOTE: If you pass options to Guvercin constructor, they will override the options in guvercin.config.json.

About

Guvercin (Turkish word for 'dove', pronounced `/ɡyverˈdʒin/`) is a very simple logger library for Node.js.

https://guvercin.js.org

License:MIT License


Languages

Language:TypeScript 81.1%Language:JavaScript 15.0%Language:Shell 4.0%