Not printing any debug statements
See original GitHub issueI’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
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Debug log is not printing - Salesforce Developer Community
Debug log is not printing. I have created a Batch class to delete records and it is working fine but when i am...
Read more >Xcode 12: print() not printing to debug area - Apple Developer
My debug console was not printing any information after the 12.0 update. The "View --> Debug Area --> Activate Console" worked for me...
Read more >How to Improve Print Statement Debugging - TotalView
PrintF debugging can get out of hand, fast! See how to improve Print Statement debugging with this in-depth article.
Read more >printf statement not printing on console during debugging
I re-compiled the code and ran again and same problem - still the printf string did not got printed - I am sure...
Read more >Some Debug.Log executes not printing - Unity Answers
I use Debug.Log for debug trace statements. Some of my Debug.Log print statements are not printing. I have tried putting: Debug.logger.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To create a
debug
instance that is always enabled, do this:No.
A namespace is just a way to group logical sets of logs together.
debug
gives you the ability to filter out particular namespaces.How you should be using
debug
is via the environment variable, not via a flag. This is what it’s for - it’s not necessarily meant to be a logging mechanism.etc.