node-pretty-logger
v1.0.5
Published
A minimal Node.js terminal console.log extension library with formatting for better readability
Maintainers
Readme
node-pretty-logger
Simple library extending
console.logfunctionality
A minimal Node.js terminal console.log extension library with formatting for better readability.
Implementation documentation can be found on https://salmon42.github.io/node-pretty-logger.
Installation
You can install this package from NPM registry https://www.npmjs.com/package/node-pretty-logger.
npm install node-pretty-loggerUsage
The main exported function useLogger has one parameter tag. Instantiating the encapsulated log functions will ensure that the console log will always mention in what context it is being run in - useful if using multiple loggers across modules.
const { info, success, warn, error } = useLogger('MainSrc')
const { info: ofInfo } = useLogger('OtherFunc')
const someData = {
attr1: 10,
attr2: 'Hi',
}
info('info')
success('success')
warn('warn')
error('error')
setLoggerConfig({ showTimeStamp: false })
info('Test', someData)
setLoggerConfig({ showTimeStamp: true })
ofInfo('Test', someData)Outputs:

License
This library is released under MIT license, which means that you can reuse any part of code here for your convenience.
Copyright (C) 2025-present, Andrej Hučko
- ~
