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

TypeScript loglevel.setLevel函数代码示例

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

本文整理汇总了TypeScript中loglevel.setLevel函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setLevel函数的具体用法?TypeScript setLevel怎么用?TypeScript setLevel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setLevel函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: return

 return (options) => {
   // handle global options
   setLevel(levels[options.parent.logLevel.toUpperCase()]);
   // handle specific action
   info(`run ${cyan(options.name())}...`);
   return action(options)
     .then(() => info(`finished ${cyan(options.name())} ♥`))
     .catch(handleError);
 };
开发者ID:Mercateo,项目名称:typedocs,代码行数:9,代码来源:index.ts


示例2: async

  return async (options: any) => {
    // handle global options
    setLevel(levels[options.parent.logLevel.toUpperCase()]);
    // handle specific action
    try {
      // update notifier runs parallel to action (if it's not ignored)
      const ignoreUpdates =
        options.parent.ignoreUpdate || project.ws.ignoreUpdates;
      const handleUpdateNotifier = ignoreUpdates
        ? undefined
        : initializeUpdateNotifier(pkg.version);

      info(`run ${cyan(options.name())}...`);
      const actionModule = await importAction();
      await actionModule.default(options);
      info(`finished ${cyan(options.name())} ♥`);

      if (handleUpdateNotifier) {
        handleUpdateNotifier();
      }
    } catch (err) {
      handleError(err);
    }
  };
开发者ID:otbe,项目名称:ws,代码行数:24,代码来源:index.ts


示例3: require

export const log = require('loglevel')

if(process.env.NODE_ENV == 'development') {
    log.setLevel('debug')
}

export function logTrace(msg: string, ...otherArgs: any[]) {
    return log.trace(msg, ...otherArgs)
}

export function logDebug(msg: string, ...otherArgs: any[]) {
    return log.debug(msg, ...otherArgs)
}

export function logInfo(msg: string, ...otherArgs: any[]) {
    return log.info(msg, ...otherArgs)
}

export function logWarn(msg: string, ...otherArgs: any[]) {
    return log.warn(`Warning: ${msg}`, ...otherArgs)
}

export function logError(msg: string, ...otherArgs: any[]) {
    return log.error(`Error: ${msg}`, ...otherArgs)
}
开发者ID:sigmacloud,项目名称:rest-resource-vue-tools,代码行数:25,代码来源:index.ts


示例4:

import * as log from 'loglevel';

if (process.env.NODE_ENV === 'development') {
    log.setLevel('debug');
} else {
    log.setLevel('info');
}

export default log;
开发者ID:rhysd,项目名称:Tui,代码行数:9,代码来源:log.ts


示例5: waitsFor

import * as chokidar from 'chokidar'
import * as fs from 'fs'
import * as loglevel from 'loglevel'
import * as path from 'path'
import * as temp from 'temp'

loglevel.setDefaultLevel(LogLevel.TRACE)
loglevel.setLevel('trace')

const log = loglevel.getLogger('ensime-cloent-startup-spec')

const testFile = expectedFile => {
  const spy = jasmine.createSpy('callback')

  const watcher = chokidar.watch(expectedFile, {
    persistent: true
  }).on('add', path => {
    spy()
    return watcher.close()
  })

  fs.writeFileSync(expectedFile, 'Hello Gaze, see me!')

  return waitsFor(() => spy.calls.count() > 0, "callback wasn't called in time", 5000)
}

xdescribe('chokidar', () => {
  it('should notice absolute paths, even from temp', () => {
    testFile(temp.track().path({ suffix: '.txt' }))
  })
开发者ID:ensime,项目名称:ensime-node,代码行数:30,代码来源:ensime-client-startup.spec.ts


示例6: require

    PlatformTools.setTargetPlatform(TargetPlatformId.TWBS_WEB);
    run =  require("../imports/for-real-cards/top-frame/top-frame.twbs.ts").run;
  }
}

import { enableProdMode } from '@angular/core';
import { prepare as prepareWeb } from "../imports/for-real-cards/top-frame/top-frame.twbs";
//import { prepare as prepareMobile } from "../imports/for-real-cards/top-frame/top-frame.ionic";


console.log("In apps.ts @" + new Date());
console.log(Meteor.absoluteUrl());

if (Meteor.isProduction) {
  console.log("Production environment detected.  Log level set to error");
  log.setLevel(LogLevel.ERROR);
  enableProdMode();
} else {
  console.log("Development environment detected.  Log level set to info");
  log.setLevel(LogLevel.TRACE);
}

if (Meteor.isCordova) {
//  prepareMobile();
  prepareWeb();
  document.addEventListener('deviceready', () => {
    //ionicSelector('for-real-cards-top-frame');
  run();
//    setClass('mobile');
  });
} else {
开发者ID:kokokenada,项目名称:for-real-cards,代码行数:31,代码来源:app.ts


示例7:

import * as log from 'loglevel';
import "/imports/for-real-cards-meteor";
import '../imports/common-app-meteor/user.model';

declare var BrowserPolicy;

log.setLevel(0, true)

Meteor.startup(function() {
  console.log('Configuring content-security-policy');
  BrowserPolicy.content.allowSameOriginForAll();
  BrowserPolicy.content.allowOriginForAll('http://192.168.0.92');
  BrowserPolicy.content.allowOriginForAll('http://fonts.googleapis.com');
  BrowserPolicy.content.allowOriginForAll('http://fonts.gstatic.com');
  BrowserPolicy.content.allowOriginForAll('https://maxcdn.bootstrapcdn.com');
  BrowserPolicy.content.allowOriginForAll('https://for-real-cards.scalingo.io');
  BrowserPolicy.content.allowOriginForAll('https://for-real-cards.fabrica.tech');
  BrowserPolicy.content.allowOriginForAll('http://for-real-cards.scalingo.io');
  BrowserPolicy.content.allowOriginForAll('http://for-real-cards.fabrica.tech');
  BrowserPolicy.content.allowOriginForAll('https://www.googletagmanager.com');
  BrowserPolicy.content.allowOriginForAll('http://www.google-analytics.com');
  BrowserPolicy.content.allowOriginForAll('https://*.firebaseio.com');
  BrowserPolicy.content.allowOriginForAll('https://firebasestorage.googleapis.com');

  BrowserPolicy.content.allowEval();
  BrowserPolicy.framing.disallow();
});
开发者ID:kokokenada,项目名称:for-real-cards,代码行数:27,代码来源:main.ts


示例8:

import * as moduleLog from 'loglevel';

moduleLog.trace('Trace message');
moduleLog.debug('Debug message');
moduleLog.info('Info message');
moduleLog.warn('Warn message');
moduleLog.error('Error message');
moduleLog.debug(['Hello', 'world', 42]);

moduleLog.setLevel(0);
moduleLog.setLevel(0, false);

moduleLog.setLevel('error');
moduleLog.setLevel('ERROR');
moduleLog.setLevel('error', false);
moduleLog.setLevel('ERROR', false);

moduleLog.setLevel(moduleLog.levels.WARN);
moduleLog.setLevel(moduleLog.levels.WARN, false);

moduleLog.enableAll(false);
moduleLog.enableAll();
moduleLog.disableAll(true);
moduleLog.disableAll();

const logLevel = moduleLog.getLevel();

const testLogger: moduleLog.Logger = moduleLog.getLogger('TestLogger');

testLogger.setLevel(logLevel);
testLogger.warn('logging test');
开发者ID:WorldMaker,项目名称:DefinitelyTyped,代码行数:31,代码来源:loglevel-tests.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript loglevel.warn函数代码示例发布时间:2022-05-25
下一篇:
TypeScript loglevel.setDefaultLevel函数代码示例发布时间: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