本文整理汇总了TypeScript中Debug.enable函数的典型用法代码示例。如果您正苦于以下问题:TypeScript enable函数的具体用法?TypeScript enable怎么用?TypeScript enable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了enable函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
const initialize = (systemEnv: string) => {
//
// Disable deprecation warnings for now while in `Development`,
// since debugging would be a mess otherwise.
//
if (systemEnv === 'Development') {
_debug.enable('Neos.Ui:*');
} else {
_debug.enable('Neos*');
}
};
示例2: debugLogger
hooks.beforeEach(function(this: TestContext) {
this.owner.register('route:application', Route.extend({ debug: debugLogger() }), {});
this.owner.register('service:my/test/module', Service.extend({ debug: debugLogger() }), {});
debug.enable('route:*, service:*');
log = sinon.stub(console, 'log');
});
示例3: constructor
/**
* Constructs a
*
* @param {Pca9685Options}
* @param {any) => any}
*/
constructor(options: Pca9685Options, cb: (error: any) => any) {
if (options.debug) {
debugFactory.enable("pca9685");
}
this.i2c = options.i2c;
this.address = options.address || constants.defaultAddress;
this.debug = debugFactory("pca9685");
this.frequency = options.frequency || constants.defaultFrequency;
const cycleLengthMicroSeconds = 1000000 / this.frequency;
this.stepLengthMicroSeconds = cycleLengthMicroSeconds / constants.stepsPerCycle;
this.send = this.send.bind(this);
this.debug("Reseting PCA9685");
this.send(constants.modeRegister1, constants.modeRegister1Default);
this.send(constants.modeRegister2, constants.modeRegister2Default);
this.allChannelsOff();
this.setFrequency(this.frequency, cb);
}
示例4: require
'use strict'
import { jd } from './utilities'
import { spawn } from 'child_process'
import * as fsep from 'fs-extra-promise'
import * as debug from 'debug'
const dedent = require('dedent')
const log = debug('elm-electron:scripts/update-README.ts')
debug.enable('*')
updateREADME()
async function updateREADME() {
const README_PATH = jd('../../README.md')
const README_BUFFER = await fsep.readFileAsync(README_PATH)
const README_CONTENTS = README_BUFFER.toString()
const SOURCE_TREE = await sourceFolderTree()
const commentMarker = c => `[//]: # (${c})`
const START_MARKER = commentMarker('START_FILE_STRUCTURE')
const END_MARKER = commentMarker('END_FILE_STRUCTURE')
const t = '```'
const pre =
`${START_MARKER}
${t}plaintext
${SOURCE_TREE}${t}
示例5:
export const setDebugScopes = scopes => {
debug.disable()
debug.enable(scopes)
}
示例6: require
///<reference path="../node_modules/angular2/ts/typings/tsd.d.ts"/>
///<reference path="../node_modules/rxjs/Rx.d.ts"/>
import { ROUTER_PROVIDERS } from 'angular2/router';
import { HTTP_PROVIDERS } from 'angular2/http';
import App from './components/app';
import {bootstrap} from "angular2/bootstrap";
let debug = require('debug');
debug.enable('ng:*');
bootstrap(App, [ROUTER_PROVIDERS, HTTP_PROVIDERS]);
示例7: debug
import Logger from './misc/logger';
import ProgressBar from './misc/cli/progressbar';
import EnvironmentInfo from './misc/environmentInfo';
import MachineInfo from './misc/machineInfo';
import DependencyInfo from './misc/dependencyInfo';
import serverStats from './daemons/server-stats';
import notesStats from './daemons/notes-stats';
import loadConfig from './config/load';
import { Config } from './config/types';
const clusterLog = debug('misskey:cluster');
const ev = new Xev();
if (process.env.NODE_ENV != 'production') {
debug.enable('misskey');
}
const pkg = require('../package.json');
//#region Command line argument definitions
program
.version(pkg.version)
.option('--no-daemons', 'Disable daemon processes (for debbuging)')
.option('--disable-clustering', 'Disable clustering')
.parse(process.argv);
//#endregion
main();
/**
示例8: startServer
import debug from 'debug';
import config from 'config';
import createApp from './create-app';
debug.enable('TF2Pickup*');
const log = debug('TF2Pickup');
const port = config.get<number>('server.port');
/**
* Start the server.
*/
async function startServer() {
try {
const app = await createApp();
const server = app.listen(port);
server.on('listening', () => {
log(`Server started on port ${port}`);
app.emit('listening');
});
} catch (error) {
log('Failed to create app', { error });
process.exit(1); // eslint-disable-line unicorn/no-process-exit
}
}
process.on('unhandledRejection', (reason) => {
示例9: debug2
import * as debug1 from "debug";
/*tslint:disable-next-line:no-duplicate-imports*/
import debug2 from 'debug';
const log2: debug1.Debugger = debug2("DefinitelyTyped:log");
log2("Just text");
log2("Formatted test (%d arg)", 1);
log2("Formatted %s (%d args)", "test", 2);
debug1.disable();
debug1.enable("DefinitelyTyped:*");
const log: debug1.Debugger = debug1("DefinitelyTyped:log");
log("Just text");
log("Formatted test (%d arg)", 1);
log("Formatted %s (%d args)", "test", 2);
log("Enabled?: %s", debug1.enabled("DefinitelyTyped:log"));
log("Name Enabled: %s", debug1.names.some(name => name.test("DefinitelyTyped:log")));
log("Namespace: %s", log.namespace);
const error: debug1.Debugger = debug1("DefinitelyTyped:error");
error.log = console.error.bind(console);
error("This should be printed to stderr");
const extendedLog: debug1.Debugger = log.extend('extended');
extendedLog("Testing this is also an IDebugger.");
const extendedWithCustomDelimiter: debug1.Debugger = log.extend('with-delim', '.');
extendedWithCustomDelimiter("Testing this is an IDebugger, too.");
示例10:
_.forEach(args.debugnamespace, (ns) => debugLib.enable(ns));