Skip to content

alex-gale/gale-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

gale-logger

Simple console logger with development option and timestamp.

How to use

const logger = require('gale-logger')

logger.log("This will be logged in production and development")
logger.log("This will only be logged in development", true)
logger.error("This is an error that will only be thrown in development", true)

Output:

[25/04/2020 - 11:28:18] This will be logged in production and development
[25/04/2020 - 11:28:18] This will only be logged in development
[25/04/2020 - 11:28:18] This is an error that will only be thrown in development

Note: Detection of production is based on use of the NODE_ENV environment variable.

About

Simple console log function with timestamp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published