edisga-customlogger

1.0.2 • Public • Published

*** This was created for internal project ***

How to import

var logger =  require('edisga-customlogger');

How to use it

This will send the output to console.log following the next syntax:

    { 
      category: category, 
      code: code,
      date: moment().format(), 
      custom: custom,
      method:method 
    }
logger.stdout("app", 1, "Listening on " + config.port ,"app.listen")

And the following for error:

    { 
      category: category, 
      code: code,
      date: moment().format(), 
      error: { 
            name: err.name, 
            message: err.message 
        }, 
      custom: custom,
      method:method 
    }
logger.stderr("db", 500 , err, "Db client was not able to connect.", "dbconnect")

Readme

Keywords

none

Package Sidebar

Install

npm i edisga-customlogger

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

2.07 kB

Total Files

3

Last publish

Collaborators

  • edisga