Skip to content

Not printing any debug statements #696

Description

@toymachiner62

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions