Installations
npm install loggerhythm
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.15.1
NPM Version
6.7.0
Score
71.7
Supply Chain
93.1
Quality
77.8
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (60.06%)
TypeScript (39.94%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
5minds
Download Statistics
Total Downloads
150,598
Last Day
2
Last Week
24
Last Month
64
Last Year
917
GitHub Statistics
2 Stars
36 Commits
18 Watching
4 Branches
4 Contributors
Bundle Size
22.17 kB
Minified
8.14 kB
Minified + Gzipped
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
150,598
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Loggerhythm
A winston-wrapper to log in a debug-like manner including namespaces
Usage
Loggerhythm exports a Logger-class, whose instances have different log-functions for different log-levels. the avaliable loglevels are:
- error
- warn
- info
- verbose
error logs to stderr
, everything else logs to stdout
!
Example
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
Methods
Static
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();
Instance-methods
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();
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 5/9 approved changesets -- score normalized to 5
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'develop'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 26 are checked with a SAST tool
Reason
57 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-897m-rjf5-jp39
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6
- Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9
- Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f
- Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm
- Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574
- Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp
- Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr
- Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6
- Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
2.4
/10
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