@homitagdev/loggerdev

1.1.0 • Public • Published

Logger

Logger helps you to write your logs in to DB. Right now it supports postgress DB alone.

Log levels are defined as follows:

Log Levels

INFO DEBUG WARNING ERROR TRACE FATAL

Example usage

Const Logger = require('Logger') let logger = new Logger('ModuleName')

logger.log('INFO', 'Login successful')

Example 2

Logger.debug('DB connection acquired')

Example 3

Logger.error(Error)

Note that you can pass the Error object or @homitag/httpstatuserror object itself to logger meessage parameter, as the Logger understand it and recognizes error messages and other respective information and writes them in to DB.

Readme

Keywords

Package Sidebar

Install

npm i @homitagdev/loggerdev

Weekly Downloads

1

Version

1.1.0

License

GPL-3.0

Unpacked Size

47 kB

Total Files

7

Last publish

Collaborators

  • eforerog