• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript Debug.enable函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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*');
    }
};
开发者ID:grebaldi,项目名称:PackageFactory.Guevara,代码行数:11,代码来源:index.ts


示例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');
  });
开发者ID:salsify,项目名称:ember-debug-logger,代码行数:7,代码来源:container-keys-test.ts


示例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);
    }
开发者ID:dannygott,项目名称:NodejsPiBot,代码行数:28,代码来源:pca9685.ts


示例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}
开发者ID:Edward-Lombe,项目名称:elm-electron,代码行数:31,代码来源:update-README.ts


示例5:

export const setDebugScopes = scopes => {
  debug.disable()
  debug.enable(scopes)
}
开发者ID:alexsandrocruz,项目名称:botpress,代码行数:4,代码来源:debug.ts


示例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]);
开发者ID:zl810881283,项目名称:RandomName,代码行数:12,代码来源:app.ts


示例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();

/**
开发者ID:ha-dai,项目名称:Misskey,代码行数:30,代码来源:index.ts


示例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) => {
开发者ID:TF2PickupNET,项目名称:TF2Pickup,代码行数:31,代码来源:index.ts


示例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.");
开发者ID:ChaosinaCan,项目名称:DefinitelyTyped,代码行数:31,代码来源:debug-tests.ts


示例10:

 _.forEach(args.debugnamespace, (ns) => debugLib.enable(ns));
开发者ID:BitGo,项目名称:BitGoJS,代码行数:1,代码来源:expressApp.ts



注:本文中的Debug.enable函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript decaffeinate-parser.parse函数代码示例发布时间:2022-05-25
下一篇:
TypeScript Debug.disable函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap