How to use the debug.load function in debug

To help you get started, we’ve selected a few debug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github localnerve / react-pwa-reference / src / application / client / sw / node_modules / sw / utils / debug.js View on Github external
.catch(function () {
        // silent failure
      });
  }

  return idb.put(idb.stores.state, key, namespaces)
    .catch(function (error) {
      console.error('debug failed to save namespace', error);
    });
};

/***
 * Echo the functionality of debugLib.
 * On module load, enable from storage.
 */
debugLib.load().then(function (namespaces) {
  debugLib.enable(namespaces);
});

/**
 * Wrap the main debugLib function
 *
 * @param {String} namespace
 * @returns {Function} The debug function for chaining.
 */
export default function debugWrapper (namespace) {
  return debugLib('sw:'+namespace);
}

// Mixin all debugLib props and methods
// eslint-disable-next-line no-unused-vars
for (let item in debugLib) {
github facebook / metro / packages / metro-bundler / react-packager.js View on Github external
function enableDebug() {
  // react-packager logs debug messages using the 'debug' npm package, and uses
  // the following prefix throughout.
  // To enable debugging, we need to set our pattern or append it to any
  // existing pre-configured pattern to avoid disabling logging for
  // other packages
  var debugPattern = 'RNP:*';
  var existingPattern = debug.load();
  if (existingPattern) {
    debugPattern += ',' + existingPattern;
  }
  debug.enable(debugPattern);
}
github facebook / metro / packages / metro / src / legacy.js View on Github external
function enableDebug() {
  // Metro Bundler logs debug messages using the 'debug' npm package, and uses
  // the following prefix throughout.
  // To enable debugging, we need to set our pattern or append it to any
  // existing pre-configured pattern to avoid disabling logging for
  // other packages
  var debugPattern = 'Metro:*';
  var existingPattern = debug.load();
  if (existingPattern) {
    debugPattern += ',' + existingPattern;
  }
  debug.enable(debugPattern);
}
github react-component / rn-packager / react-native / packager / react-packager.js View on Github external
function enableDebug() {
  // react-packager logs debug messages using the 'debug' npm package, and uses
  // the following prefix throughout.
  // To enable debugging, we need to set our pattern or append it to any
  // existing pre-configured pattern to avoid disabling logging for
  // other packages
  var debugPattern = 'RNP:*';
  var existingPattern = debug.load();
  if (existingPattern) {
    debugPattern += ',' + existingPattern;
  }
  debug.enable(debugPattern);
}
github liquality / chainabstractionlayer / packages / client / lib / Client.js View on Github external
static debug (namespace = '*') {
    // if localStorage.DEBUG (browser)
    // or process.env.DEBUG (node) is not set
    if (!debug.load()) {
      debug.enable(namespace)
    }
  }
github microsoft / react-native-windows / packager / react-packager / index.js View on Github external
function enableDebug() {
  // react-packager logs debug messages using the 'debug' npm package, and uses
  // the following prefix throughout.
  // To enable debugging, we need to set our pattern or append it to any
  // existing pre-configured pattern to avoid disabling logging for
  // other packages
  var debugPattern = 'ReactNativePackager:*';
  var existingPattern = debug.load();
  if (existingPattern) {
    debugPattern += ',' + existingPattern;
  }
  debug.enable(debugPattern);
}
github facebook / metro / react-packager / react-packager.js View on Github external
function enableDebug() {
  // react-packager logs debug messages using the 'debug' npm package, and uses
  // the following prefix throughout.
  // To enable debugging, we need to set our pattern or append it to any
  // existing pre-configured pattern to avoid disabling logging for
  // other packages
  var debugPattern = 'RNP:*';
  var existingPattern = debug.load();
  if (existingPattern) {
    debugPattern += ',' + existingPattern;
  }
  debug.enable(debugPattern);
}