How to use the debug.enable 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 codesandbox / codesandbox-client / src / app / utils / debug.js View on Github external
return (key: string) => (message: string) => {
      if (typeof window.Raven === 'object') {
        try {
          Raven.captureBreadcrumb({
            message: `${key} - ${message}`,
            category: 'logging',
          });
        } catch (e) {
          console.error(e);
        }
      }
    };
  }

  const debug = require('debug'); // eslint-disable-line global-require
  debug.enable('cs:*');
  return debug;
};
github insideout10 / wordlift-plugin / src / scripts / modules / log.js View on Github external
/**
 * External dependencies
 */
import debug from 'debug';

const log = debug( 'wordlift:log' );

// Enable the logger.
debug.enable( '*' );

export default log;
github d-oliveros / nest / index.js View on Github external
const debug = require('debug');

debug.enable('nest:worker*');
debug.enable('nest:spider*');
debug.enable('nest:item*');

module.exports = require('./lib/nest').default; // eslint-disable-line import/no-unresolved
github d-oliveros / nest / cli / run.js View on Github external
const assert = require('assert');
const debug = require('debug');
const path = require('path');
const Nest = require('../index');

const rootdir = process.cwd();

debug.enable('nest:worker*');
debug.enable('nest:spider*');
debug.enable('nest:item*');

/**
 * Requires a script located at 'scriptPath'.
 * @param  {String}  scriptPath  Relative path of file to require().
 */
module.exports = function run(scriptPath) {
  scriptPath = scriptPath || 'index';

  const nest = new Nest(rootdir);
  let func = require(path.join(rootdir, scriptPath)); // eslint-disable-line

  if (typeof func === 'object' && typeof func.default === 'function') {
    func = func.default;
  }
github dotnet / aspnetcore / src / SignalR / clients / ts / FunctionalTests / scripts / run-tests.ts View on Github external
let noColor = false;
let skipNode = false;
let sauceUser = null;
let sauceKey = null;
let publicIp = false;
let hostname = null;

for (let i = 2; i < process.argv.length; i += 1) {
    switch (process.argv[i]) {
        case "--configuration":
            i += 1;
            configuration = process.argv[i];
            break;
        case "-v":
        case "--verbose":
            _debug.enable("signalr-functional-tests:*");
            break;
        case "-vv":
        case "--very-verbose":
            _debug.enable("*");
            break;
        case "--spec":
            i += 1;
            spec = process.argv[i];
            break;
        case "--sauce":
            sauce = true;
            console.log("Running on SauceLabs.");
            break;
        case "--skip-node":
            skipNode = true;
            console.log("Running on SauceLabs.");
github craft-ai / craft-ai-client-js / test / nodejs / helper.js View on Github external
import _ from 'lodash';
import Debug from 'debug';
import dotenv from 'dotenv';
import { expect } from 'chai';

dotenv.load({ silent: true });

const CRAFT_CFG = {
  owner: process.env.CRAFT_OWNER,
  project: process.env.CRAFT_PROJECT,
  token: process.env.CRAFT_TOKEN
};

Debug.enable(process.env.DEBUG);

global._ = _;
global.CRAFT_CFG = CRAFT_CFG;
global.debug = Debug('craft-ai:client:test');
global.expect = expect;
global.IN_BROWSER = false;
global.RUN_ID = process.env.TRAVIS_JOB_ID || 'local';
global.DISABLE_LONG_TESTS = process.env.DISABLE_LONG_TESTS;
github Wyliodrin / WyliodrinSTUDIO / source / public / controllers / TerminalDialogController.js View on Github external

"use strict";

var angular = require ('angular');

var settings = require ('settings');
require ('debug').enable (settings.debug);
var debug = require ('debug')('wyliodrin:lacy:TerminalDialogController');

var mixpanel = require ('mixpanel');

debug ('Loading');

module.exports = function ()
{

	var app = angular.module ('wyliodrinApp');

	app.controller ('TerminalDialogController', function ($scope, device)
	{
		debug ('Registering');
		console.log ('terminal controller');
		console.log(device);
github Wyliodrin / WyliodrinSTUDIO / source / public / controllers / InstallController.js View on Github external

"use strict";

var angular = require ('angular');

var settings = require ('settings');
require ('debug').enable (settings.debug);
var debug = require ('debug')('wyliodrin:lacy:InstallController');

var _ = require ('lodash');

var mixpanel = require ('mixpanel');

debug ('Loading');

module.exports = function ()
{

	var app = angular.module ('wyliodrinApp');

	app.controller('InstallController', function($scope, $timeout, $filter, $wydevice, $mdDialog){
		debug ('Registering');
github datosgobar / consulta-publica / lib / debug / index.js View on Github external
/**
 * Module dependencies.
 */

import debug from 'debug'

/**
 * Initialize debug
 */

const key = window.localStorage.debug

if (key === '*') {
  debug.enable('democracyos:*')
} else if (key) {
  debug.enable(key)
}

export default debug
github prisma / photonjs / packages / engine-core / src / Engine.ts View on Github external
prismaYmlPath,
    datamodel,
    schemaInferrerPath,
    prismaPath,
    ...args
  }: EngineConfig) {
    this.prismaYmlPath = prismaYmlPath
    this.prismaConfig = prismaConfig
    this.cwd = prismaYmlPath ? path.dirname(this.prismaYmlPath) : process.cwd()
    this.debug = args.debug || false
    this.datamodelJson = datamodelJson
    this.datamodel = datamodel
    this.schemaInferrerPath = schemaInferrerPath || Engine.defaultSchemaInferrerPath
    this.prismaPath = prismaPath || Engine.defaultPrismaPath
    if (this.debug) {
      debugLib.enable('engine')
    }
    this.startPromise = this.start()
  }