Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example code not working #113

Open
devolution2409 opened this issue Aug 29, 2021 · 0 comments
Open

Example code not working #113

devolution2409 opened this issue Aug 29, 2021 · 0 comments

Comments

@devolution2409
Copy link

devolution2409 commented Aug 29, 2021

Hi,
Just installed your packaged and tried to play around with it using the example provided on the npm page.

The following line will trigger an error despite the comment saying it should work.
console.verbosity('warning'); // Use named levels [debug, info, log, warning, error]

Here's the error:

node_modules\verbosity\index.js:118
      level = typeof level === 'string' ? this.matrix[level].level : level;
 TypeError: Cannot read property 'level' of undefined
    at console.verbosity 
node_modules\verbosity\index.js:118:62)

And the full code:

import { createConsole } from 'verbosity';

const console = createConsole({
  outStream: process.stdout,
  errorStream: process.stderr,
  verbosity: 5,
});
console.verbosity('warning'); // Use named levels [debug, info, log, warning, error]

console.debug('...this isn’t printed now.');

Maybe i misunderstood the comment in which case i apologize :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant