UNPKG

379 BJavaScriptView Raw
1'use strict';
2
3var diagnostics = process.env.BROWSERIFYSHIM_DIAGNOSTICS;
4
5function inspect(obj, depth) {
6 return require('util').inspect(obj, false, depth || 5, true);
7}
8
9exports = module.exports = function debug() {
10 if (diagnostics) console.error.apply(console, arguments);
11}
12
13exports.inspect = function(obj, depth) {
14 if (diagnostics) console.error(inspect(obj, depth));
15}