This reverts commit 8dd8345d1498b8c6a3c6d7f7f4ebc600cfd2195b.
We shouldn't have changed the original behavior, which
too many people are relying on at this point.
It's also technically a breaking change, which we shouldn't
have landed on a minor/patch version change. So in the interest
of not breaking people's logs in production, reverting this.
We can discuss in a new issue if we want to restore this patch
for a `v3` release, but at the moment I'm personally leaningo
towards *no*, for historical reasons (i.e. this is reminding
me of Node.js trying to remove `sys` if anybody reading this
remembers those days).
See the discussion in #250 for more backlog.
Split log() into 2 methods: formatArgs() and log(), allowing log to be
overridden on a per-namespace or global level. Global log settings trump
per-namespace settings.
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.
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...