This library provides a function log() which is like console.log, but with superpowers: it can be used in expressions - f(log(x)), and it supports plugins. For example, there are plugins for setting a severity level, for adding badges, and for logging functions, iterables, promises and RxJS observables. Instead of writing log messages to the console, you can inspect them in unit tests with help of Jest's snapshots feature.
The library is fully documented, but I've also written an article that introduces it to RxJS users (logging RxJS observables is just one use case, but one which the library grew out from): https://dev.to/ivan7237d/log-and-test-rxjs-observables-with-1log-5cbm
1log alternatives and similar libraries
Based on the "Log" category.
Alternatively, view 1log alternatives based on common mentions on social networks and blogs.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of 1log or a related project?
<!-- README for NPM; the one for GitHub is in .github directory. -->
This library provides a function
log that can be used as the regular
console.log, but has two superpowers: you can insert it into any expression, as in
f(log(x)), and it supports plugins. There are plugins for setting severity level, for logging functions, async functions, promises, iterables, async iterables, observables, for creating snapshots of log messages in Jest tests, and more.
Please refer to the GitHub README for full documentation and screenshots.