26 Commits

Author SHA1 Message Date
Nathan Rajlich
25e07c78fc don't call splice() when indexOf() returns -1 2017-08-08 14:42:25 -07:00
Nathan Rajlich
02eb3c607e fix lint 2017-08-08 14:42:25 -07:00
Nathan Rajlich
5ed41f6d92 add Web Browser 256 colors
Like #481, but for the web browser.
2017-08-08 14:42:25 -07:00
Josh Junon
65192b755d use contrast-bounded colors 2017-08-08 14:42:25 -07:00
antoine.leveugle
39eb2770a2 Use Date#toISOString() instead to Date#toUTCString() when output is not a TTY
Easier to parse programatically and contains milliseconds.

Closes #418.
2017-08-08 14:42:25 -07:00
Josh Junon
d5854f4eb6 support 256 colors
Closes #481.
2017-08-08 14:42:25 -07:00
Nathan Rajlich
bf88540737 enabled() updates existing debug instances, add destroy() function (#440)
* dynamically updatable instances

* add a `destroy()` function to debug instances

So that "dynamically created instances" can clean up after themselves
2017-08-08 14:42:25 -07:00
George Joseph
9d7c997992 Make millisecond timer namespace specific and allow 'always enabled' output (#408)
* Make millisecond timer namespace specific

When debugging node apps, I find it much more useful for the
millisecond timer to be relative to last message from the same
namespace instead of any message. This is especially true when I'm
debugging across multiple libraries or multiple levels in the same
module and I'm interested in seeing all the messages but also need to
compare times from specific levels.

* Enable 'always enabled' output

Having to deal with 2 different logging mechanisms, one for debugging
and one for normal output, can be a nuisance.  It would be much easier to
always use the same facility and semantics for both.  This patch allows
an 'always enabled' namespace to be specified by appending a single '*'
to the namespace name.

var alwaysOn = require('debug')('normal:messages*');
alwaysOn('This will always display regardless of DEBUG');
2017-08-08 14:42:25 -07:00
Nathan Rajlich
ff432e76e9 Remove DEBUG_FD (#406)
* remove DEBUG_FD

Now simply uses `process.stderr`. Breaking API change,
for the v3 branch.

Previously used internal and undocumented Node.js APIs to support
this underly used API.

Fixes #280
Closes #386

* remove DEBUG_FD from readme
2017-08-08 14:42:25 -07:00
Marc MacLeod
2482e08e4e Check for undefined on browser globals (#462)
* Check for undefined on browser globals.

Not all environments include these globals. For example, web workers do not have global window objects.

* remove redundant global checks
2017-05-18 09:38:54 -07:00
Douglas Wilson
1351d2f91f Inline extend function in node implementation (#452) 2017-05-10 15:51:27 -07:00
Andrew E. Rhyne
cae07b70c9 cleanup browser tests and fix null reference check on window.documentElement.style.WebkitAppearance (#447) 2017-04-27 08:59:02 -07:00
Lucian Buzzo
1f01b70f88 Fix bug that would occure if process.env.DEBUG is a non-string value. (#444)
Connects to #443
2017-04-20 11:04:28 -07:00
Paul Betts
0fb8ea4730 LocalStorage returns undefined for any key not present (#431) 2017-03-13 20:43:57 -07:00
slavaGanzin
23bc780b84 fix DEBUG_MAX_ARRAY_LENGTH 2017-02-22 11:18:13 -08:00
Pooya Parsa
37e14d6aad Whitelist DEBUG_FD for values 1 and 2 only Fixes #410 (#415)
* Hide in DEBUG_FD deprecation warning in Webstorm Fixes #410

+ Intellij idea

* Hide in DEBUG_FD deprecation warning in Webstorm Fixes #410

* whitelist DEBUG_FD for values 1 and 2 only

* Use appreciate depreciation message
2017-01-23 17:42:32 -08:00
vgoma
78ae6c9412 Fixed IE8 "Expected identifier" error 2017-01-16 22:00:27 +03:00
Mykyta Usikov
1c163a48c1 added names and skips arrays erasing on enable call (#409) 2017-01-04 13:58:28 -06:00
Andrew E. Rhyne
589559502a better null pointer checks for browser useColors 2016-12-28 23:46:46 -06:00
Nathan Rajlich
664613047c remove explicit window.debug export (#404)
Exporting to the "outer" scope of the module is more the responsibility
of the module loader (i.e. browserify, webpack, etc.) and thus this
is not necessary. `make test-browser` still passes after this patch.
2016-12-28 23:27:52 -06:00
Nathan Rajlich
62df220d20 Deprecate DEBUG_FD (#405)
* remove DEBUG_FD from readme

* deprecate DEBUG_FD

* remove arrow function

ES6 habbits hit hard :D
2016-12-27 18:25:09 -06:00
Klaus Trainer
eba68cec1a fix(browser): prevent ReferenceError in workers (#393)
fixes #382
2016-12-25 18:34:37 -08:00
Andrew E. Rhyne
d85c0c613d build perf, fix for bowerfile, fix for webworker 2016-12-20 20:44:57 -08:00
Accalia de Elementia
f512cf2367 Merge remote-tracking branch 'upstream/master' into replace-babel-with-browserify 2016-12-21 01:42:09 +00:00
Yami
2a01c6c775 Merged from upstream/master. I left the dist/debug in place because my hook now updates it automatically, but I removed the babelrc file since we don't need it anymore. 2016-12-20 12:27:29 +00:00
Yami
f42b962792 refactor: Moved source files to /src. Moved test files to client and server side tests. Added karma for front-end testing. 2016-12-16 15:19:40 +00:00