0.0.14 • Published 8 years ago

@hke/debug v0.0.14

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

Build Status

@hke/debug

What is @hke/debug?

@hke/debug is a little wrapper module for console.log(). Depending on the verbose- and log-level it prints and/or saves all logs passed to debug.log().

How to use

Include @hke/debug in your code. @hke/debug comes with three kinds of log types and two destinations to log.

The log types/levels are 0 = INFO, 1 = WARNING, 2 = ERROR.

The two different destitinations are the console and, depending on the platform used, the file system or localstorage/indexeddb. Where and which logs are displayed or saved is managed with the loglevel (DEFAULT = 2) and verbose (DEFAULT = 1) properties.

var debug = require('@hke/debug');

// some code

console.log(debug.level); // 2
console.log(debug.verbose); // 1

debug.log('information'); // won't do anything
debug.warn('warning'); // prints 'warning'
debug.error('error'); // prints 'error' and saves

debug.setVerbose(2); // only errors will be printed
debug.setLevel(0); // severything will be saved

// more code
0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago