Gathering detailed insights and metrics for loggerhythm
Gathering detailed insights and metrics for loggerhythm
npm install loggerhythm
Typescript
Module System
Node Version
NPM Version
71.7
Supply Chain
93.1
Quality
77.8
Maintenance
100
Vulnerability
100
License
JavaScript (60.06%)
TypeScript (39.94%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
150,598
Last Day
2
Last Week
24
Last Month
64
Last Year
917
2 Stars
36 Commits
18 Watching
4 Branches
4 Contributors
Minified
Minified + Gzipped
Latest Version
3.0.4
Package Id
loggerhythm@3.0.4
Size
6.83 kB
NPM Version
6.7.0
Node Version
10.15.1
Publised On
26 Feb 2019
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
118.2%
24
Compared to previous week
Last month
106.5%
64
Compared to previous month
Last year
-66.8%
917
Compared to previous year
1
A winston-wrapper to log in a debug-like manner including namespaces
Loggerhythm exports a Logger-class, whose instances have different log-functions for different log-levels. the avaliable loglevels are:
error logs to stderr
, everything else logs to stdout
!
1const Logger = require('loggerhythm').Logger; 2// import {Logger} from 'loggerhythm'; // for TypeScript 3 4const logger = new Logger('readme-namespace'); 5// alias: logger = logger.createLogger('readme-namespace'); 6 7logger.info('foo');
The output would look like this (the different log-leves use different colors):
2016-08-30T14:06:33.751Z - info: [readme-namespace] foo
2016-08-30T14:06:33.752Z - warn: [readme-namespace] bar
The Logger-Class has static methods, that can be used to globally set loggerhythm-config and register global log-hooks:
1const Logger = require('loggerhythm').Logger; 2// import {Logger, LogLevel} from 'loggerhythm'; // for TypeScript 3 4// get informed about all Logs everywhere 5const subscription = Logger.subscribe((logLevel, namespace, message, ...logObjects) => { 6 // do stuff 7}); 8 9// do stuff 10 11// unsubscribe 12subscription.dispose();
The Instances of the Logger-class have a log-method for every loglevel and a subscribe-method to get informed about logs of that instance
1const Logger = require('loggerhythm').Logger; 2// import {Logger} from 'loggerhythm'; // for TypeScript 3 4const logger = Logger.createLogger('readme-namespace'); 5 6// get informed about all the logs of that instance 7const subscription = Logger.subscribe((logLevel, namespace, message, ...logObjects) => { 8 // namespace will always be 'readme-namespace' here 9 // do stuff 10}); 11 12logger.error('error-log', new Error('hello')); 13logger.warn('warning-log'); 14logger.info('have some info', {v1: 1, v2: 2, test: ['some', 'test', 'array']}); 15logger.verbose('some', 'more detailed', 'info'); 16 17// this loggers namespace will be 'readme-namespace:child-logger-lamespace' 18const logger2 = logger.createChildLogger('child-logger-lamespace'); 19 20// do stuff 21 22// unsubscribe 23subscription.dispose();
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/9 approved changesets -- score normalized to 5
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
57 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More