Skip to content

Example code not working #113

@devolution2409

Description

@devolution2409

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 :)

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