Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
node-chroma-logger
Advanced tools
A zero-dependency minimalist asynchronous Node.js chromatic logger
A zero-dependency minimalist asynchronous Node.js chromatic logger. When you want colors, don't want to use mainly synchronous logging methods of Console
and get rid of a complex logger.
npm install --save node-chroma-logger
Code style follows Airbnb JavaScript Best Practices using ESLint.
Mocha and Chai for unit testing.
npm audit
.name | description | required | default |
---|---|---|---|
NODE_CHROMA_LOGGER_DISABLE_COLOR | Wether to disable setting color (escape sequences). It is especially needed if the terminal does not have the feature to display colors at all or you just don't want any color. It is always set to false so that terminals that are not detected as able to display colors like for Gitlab CI pipelines for an example can always have colors displayed. Accepted values: true or 1 . | false | |
NODE_CHROMA_LOGGER_DISABLE_DATE_FORMAT | Wether to disable showing date in the log format. Accepted values: true or 1 . | false | |
NODE_CHROMA_LOGGER_DISABLE_SEVERITY_FORMAT | Wether to disable showing severity in the log format. Accepted values: true or 1 . | false | |
NODE_CHROMA_LOGGER_SEVERITY | Logger severity selected. See logger severities. Higher severities, if any, are activated. | trace |
Sorted by highest to lowest severity.
severity | description | color | data stream |
---|---|---|---|
fatal | The service/app is going to stop or become unusable now. An operator should definitely look into this soon. | background light red | stderr |
error | Fatal for a particular request, but the service/app continues servicing other requests. An operator should look at this soon(ish). | red | stderr |
warn | A note on something that should probably be looked at by an operator eventually. | yellow | stderr |
info | Detail on regular operation. | cyan | stdout |
log | Detail on regular operation. Same severity rank as info . | default | stdout |
success | Detail on a successful operation. Same severity rank as info . | green | stdout |
debug | Anything else, i.e. too verbose to be included in info severity. | light magenta | stdout |
trace | Logging from external libraries used by the app or very detailed application logging. | dark gray | stdout |
disable | Logging is disabled. | none | none |
const logger = require('node-chroma-logger');
logger
<Object> with the following properties.fatal(args)
<Function>
args
<Any>Example:
logger.fatal('this was fatal, this has to stop!');
error(args)
<Function>
args
<Any>Example:
logger.error('this was an error!', new Error('bad stuff'));
warn(args)
<Function>
args
<Any>Example:
logger.warn('ooooooops, be careful');
info(args)
<Function>
args
<Any>Example:
logger.info('this is so helpful thanks');
log(args)
<Function>
args
<Any>Example:
logger.log('log is at same level as info but without any specific color');
success(args)
<Function>
args
<Any>Example:
logger.success('same as above, let\'s go!!');
debug(args)
<Function>
args
<Any>Example:
logger.debug({ hello: 'world' }, 'hi', 'this is just to have this info with some more details');
trace(args)
<Function>
args
<Any>Example:
logger.trace('this is a very detailed log', { details: 100 }, ['details', 'details']);
None.
npm run lint
npm test
/
This project has a Code of Conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
Please take a moment to read our Contributing Guidelines if you haven't done so yet.
Please see our Support page if you have any questions or for any help needed.
For any security concerns or issues, please visit our Security Policy page.
MIT.
1.1.0 - delivery @17/07/2023
FAQs
A zero-dependency minimalist asynchronous Node.js chromatic logger
The npm package node-chroma-logger receives a total of 6 weekly downloads. As such, node-chroma-logger popularity was classified as not popular.
We found that node-chroma-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.