* This is the web browser implementation of `debug()`.
*/
-exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = localstorage();
+exports.destroy = (() => {
+ let warned = false;
+
+ return () => {
+ if (!warned) {
+ warned = true;
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+ };
+})();
/**
* Colors.
}
/**
- * Invokes `console.log()` when available.
- * No-op when `console.log` is not a "function".
+ * Invokes `console.debug()` when available.
+ * No-op when `console.debug` is not a "function".
+ * If `console.debug` is not available, falls back
+ * to `console.log`.
*
* @api public
*/
-function log(...args) {
- // This hackery is required for IE8/9, where
- // the `console.log` function doesn't have 'apply'
- return typeof console === 'object' &&
- console.log &&
- console.log(...args);
-}
+exports.log = console.debug || console.log || (() => {});
/**
* Save `namespaces`.