An ES6 class for writing logs to DB. Currently posgres alone supported
npm install @homitagdev/loggerdevLogger helps you to write your logs in to DB. Right now it supports postgress DB alone.
Log levels are defined as follows:
Const Logger = require('Logger')
let logger = new Logger('ModuleName')
logger.log('INFO', 'Login successful')
Logger.debug('DB connection acquired')
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.