Gathering detailed insights and metrics for loggerhythm
Gathering detailed insights and metrics for loggerhythm
Gathering detailed insights and metrics for loggerhythm
Gathering detailed insights and metrics for loggerhythm
npm install loggerhythm
Typescript
Module System
Node Version
NPM Version
JavaScript (60.06%)
TypeScript (39.94%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
36 Commits
17 Watchers
4 Branches
4 Contributors
Updated on Feb 02, 2024
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
Published on
Feb 26, 2019
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
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
58 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
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