23 Commits

Author SHA1 Message Date
Nathan Rajlich
61394bf18e debug: use "ms" module for humanizing the diff
This would be the first external dependency for `debug`,
so it's slightly controversial.
2014-05-31 13:24:29 -07:00
Nathan Rajlich
83bae02343 debug: invoke save() at the beginning of enable()
We modify the `namespaces` argument directly for some reason,
which ends up saving input that ends up being invalid RegExp code
upon the next `load()`+`enable()` call combo.

Avoid that completely by just saving the input directly first thing.
Fixes browsers since they actually use the "saved" value.
2014-05-30 22:14:10 -07:00
Nathan Rajlich
2cffe24185 rewrite: abstract common logic for Node & browsers 2014-05-30 00:10:10 -07:00
Antoine Lehurt
bb21abf651 Catch localStorage security error when cookies are blocked (Chrome)
If cookies are disabled on Chrome, `window.localStorage` throws an error
`Uncaught Error: SecurityError: DOM Exception 18`
2013-05-29 11:13:53 +02:00
TJ Holowaychuk
f4c8e1ea6c add .message error fallback 2013-04-16 07:09:48 -07:00
TJ Holowaychuk
97a362f7d0 add debug(err) support. Closes #46 2013-04-16 06:54:38 -07:00
Robert Sköld
83aaaac519 Mobile Safari (private mode) is broken with debug
Mobile Safari has a dumb feature where it goes ahead and throws an exception when trying to access the localStorage in private mode.  

Other people with the same issue: 
http://meta.stackoverflow.com/questions/123116/safari-5-1-2-log-in-doesnt-work  

Simply wrapping the local storage access in a try/catch should do the trick...
2013-01-31 17:48:20 +01:00
Robert Sköld
77531e47dd Adapted to new component spec. 2012-10-10 21:40:57 +02:00
TJ Holowaychuk
fd3ad212ad removed file heading comments 2012-05-04 14:01:23 -07:00
Vinay Pulim
883f44558c support "-" prefix on the client 2012-02-07 18:08:28 -05:00
Tj Holowaychuk
29f968022d Added humanize() to CS variant 2012-02-02 16:53:36 -08:00
Tj Holowaychuk
27fc4c58c7 Added debug.disable() to the CS variant 2012-02-02 16:48:22 -08:00
Tj Holowaychuk
8ea07bc911 Fixed: persist client-side variant again. Closes #9 2012-02-02 16:46:21 -08:00
Tj Holowaychuk
1335463519 Removed padding from CS variant 2012-02-02 16:41:54 -08:00
Tj Holowaychuk
6e5e31548b moar refactoring 2012-02-01 12:19:07 -08:00
Tj Holowaychuk
622f59a7a1 removed prev/names globals 2012-02-01 12:18:13 -08:00
Tj Holowaychuk
875a49733e misc refactoring 2012-02-01 12:17:06 -08:00
Tj Holowaychuk
9df0b38dfd added diff padding to the CS 2012-02-01 12:16:14 -08:00
Nathan Rajlich
426d6c2b1d Missing semicolon. 2012-02-01 11:56:04 -08:00
Nathan Rajlich
97c6ddf070 Add debug.enable and debug.enabled APIs.
Makes wildcard filters work once again.
2012-02-01 11:54:32 -08:00
Nathan Rajlich
811471fba2 Make it work in IE8. 2012-02-01 11:06:28 -08:00
Nathan Rajlich
81ed7be977 Don't use localStorage, require a debug.enable function instead. 2012-02-01 11:02:22 -08:00
Tj Holowaychuk
ecf3e067e1 Added quick hack of a client-side version
obviously wouldnt work for older browsers but who
cares ;)
2012-01-30 09:38:43 -08:00