silly-logging-function

1.0.0 • Public • Published

silly-logging-function

A logging function so simple it's silly

Best used with apps that log to the console, for example when inside a Docker container.

While testing, if NODE_ENV is set to 'test', no log message will be generated.

The following environment variables will be added to the log:

  • NODE_ENV as 'environment'
  • APP as 'app'

Installation

$ npm install silly-logging-function

Usage

const logger = require('silly-logging-function')

const myFunction = (arg) => {
  logger({
    arg,
    message: `Received log message ${arg}`
  })
}

myFunction('test')

Output

{"timestamp":"2021-06-19T04:01:04.186Z","details":{"arg":"test","message":"Received log message test"}}

Readme

Keywords

Package Sidebar

Install

npm i silly-logging-function

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

3.17 kB

Total Files

5

Last publish

Collaborators

  • mlefebvr