1.1.0 • Published 5 years ago

@homitagdev/loggerdev v1.1.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
5 years ago

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.