Skip to content

fabiopavesi/ask-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASK Logger

This is a simple Logger class for both NodeJS and Browser use.

It uses colours to easily distinguish message logging levels.

It is a work in progress.

Installation

npm i ask-logger

Usage

debug

const logger = Logger.getLogger('Main program')

logger.set_level(LogLevel.DEBUG)

logger.debug('This is an example', 123, {
    name: 'Joe',
    age: 25
})

Alt text

info

const logger = Logger.getLogger('Main program')

logger.set_level(LogLevel.DEBUG)

logger.info('This is an example', 123, {
    name: 'Joe',
    age: 25
})

Alt text

warn

const logger = Logger.getLogger('Main program')

logger.set_level(LogLevel.DEBUG)

logger.warn('This is an example', 123, {
    name: 'Joe',
    age: 25
})

Alt text

error

const logger = Logger.getLogger('Main program')

logger.set_level(LogLevel.DEBUG)

logger.error('This is an example', 123, {
    name: 'Joe',
    age: 25
})

Alt text

no output

To prevent all output, simply set the logging level to LogLevel.NONE

const logger = Logger.getLogger('Main program')

logger.set_level(LogLevel.NONE)

logger.error('This is an example', 123, {
    name: 'Joe',
    age: 25
})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published