Not printing any debug statements
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
Research direction
The runnable entry point is the deleteUserData script shown in the issue; start by checking the debug import and invocation against debug 4.1.1's documented Node usage. Re-run the supplied command with -b and confirm that the debug statement is emitted as expected.
Written by the indexing model from the issue text.
Description
I'm sure i'm doing something wrong, but I have this code and it's not printing any debug statement's
#!/usr/bin/env node
const axios = require('axios')
const program = require('commander')
const debug = require('debug')
const config = require('./config.json')
const getJwt = require('./getJwt.js')
const package = require('./package.json')
const { envs } = require('./util')
program
.usage('[options]')
.description('Delete files/data for a specific account')
.option('-v --version', package.version)
.option('-e --env <env>', 'Environment to create account for. Options are "dev", "qa", stage", or "prod"')
.option('-m, --email <required>', 'email')
.option('-p, --password <required>', 'password')
.option('-a --all', 'Remove all files and documents')
.option('-b --debug', 'Enable debug mode')
.parse(process.argv)
if (program.debug) {
console.log('in program.debug')
debug.enable('debug')
}
console.log('debug is enabled =', debug.enabled('debug'))
debug('here') // WHY ISN'T THIS PRINTING?
And here's the output from my command:
$ ./deleteUserData -e dev -m foo@example.com -p myPassword -a -b
in program.debug
debug is enabled = true
I'm using version 4.1.1 of debug
- Dominant language
- JavaScript
- Stars
- 11.5k
- Forks
- 992
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from debug-js/debug
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Debug as JSON Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 28/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·