Installations
npm install winston-like-debug
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
16.15.0
NPM Version
8.12.1
Score
68.2
Supply Chain
98.3
Quality
73.9
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
edus44
Download Statistics
Total Downloads
77,326
Last Day
201
Last Week
201
Last Month
3,666
Last Year
55,353
GitHub Statistics
1 Stars
7 Commits
1 Watching
5 Branches
1 Contributors
Bundle Size
24.57 kB
Minified
9.25 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.3.1
Package Id
winston-like-debug@1.3.1
Unpacked Size
7.11 kB
Size
2.73 kB
File Count
5
NPM Version
8.12.1
Node Version
16.15.0
Total Downloads
Cumulative downloads
Total Downloads
77,326
Last day
0%
201
Compared to previous day
Last week
-76.8%
201
Compared to previous week
Last month
-7%
3,666
Compared to previous month
Last year
673.1%
55,353
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
winston-like-debug
Format logs with Winston like you do with Debug
1const log = require('./logger')('my.controller') 2 3log.info('hi', { from: 'foo' }) 4log.verbose({ some: 'test' }) 5log.warn('Invalid userid') 6log.silly('Hi %s', 'Bob', { greetings: true }, { when: Date.now() }) 7log.error('Error reading file') 8log.debug('config', { my: 'var' })
Install
yarn add winston-like-debug
npm install winston-like-debug
Usage
logger.js
1const winston = require('winston')
2const { likeDebug, withNamespace } = require('winston-like-debug')
3
4const logger = winston.createLogger({
5 // This is required to be at top level format
6 // See https://github.com/winstonjs/winston/issues/1430
7 format: winston.format.splat(),
8})
9
10logger.add(
11 new winston.transports.Console({
12 level: 'silly',
13 format: likeDebug(),
14 })
15)
16
17logger.add(
18 new winston.transports.File({
19 level: 'debug',
20 filename: __dirname + '/output.log',
21 format: likeDebug({ colors: false }),
22 })
23)
24
25module.exports = withNamespace(logger)
Using namespaced logger
index.js
1const log = require('./logger')('root') 2 3log.verbose('listening', { host: 'localhost' }, { port: 3000 })
Console output:
output.log file content:
2010-01-30T10:04:43.824Z VERBOSE root listening {"host":"localhost","port":3000}
Namespace based on filename
auth.controller.js
1const log = require('./logger')(module) 2 3log.warn('login', { userId: 98356190 })
Console output:
output.log file content:
2010-01-30T10:08:03.386Z WARN auth.controller login {"userId":98356190}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
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
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
13 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- 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-c2qf-rxjj-qqgw
Score
1.3
/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