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

TypeScript loglevel.getLogger函数代码示例

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

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



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

示例1: getLogger

 public getLogger (): log.Logger {
   let prefix = require('loglevel-plugin-prefix')
   prefix.apply(
     log,
     {
       template: '[%t] %l (%n)'
     }
   )
   log.setDefaultLevel(this.loglevel as log.LogLevelDesc)
   let logger = log.getLogger('socko')
   return logger
 }
开发者ID:dploeger,项目名称:socko,代码行数:12,代码来源:DefaultOptions.ts


示例2: afterEach

import * as fs from 'fs';
import * as loglevel from 'loglevel';
import * as os from 'os';
import * as path from 'path';
import * as rimraf from 'rimraf';

import {clean} from './clean';
import {convertArgs2AllOptions} from './utils';

const log = loglevel.getLogger('webdriver-manager-test');
log.setLevel('debug');

describe('using the cli', () => {
  const tmpDir = path.resolve(os.tmpdir(), 'test');
  afterEach(() => {
    try {
      rimraf.sync(tmpDir);
    } catch (err) {
    }
  });

  describe('a user runs clean', () => {
    it('should not log or throw errors if no folder exists', () => {
      const argv = {
        _: ['foobar'],
        out_dir: tmpDir,
        '$0': 'bin\\webdriver-manager'
      };
      const options = convertArgs2AllOptions(argv);
      const statusLog = clean(options);
      expect(statusLog).toBe('');
开发者ID:angular,项目名称:webdriver-manager,代码行数:31,代码来源:clean.spec-e2e.ts


示例3: require

require('source-map-support').install();

import * as loglevel from 'loglevel';
import {AbcApiConfig} from './AbcApiConfig';
import {ApiServer} from './server/ApiServer';
import {getDaoMap} from './lib/database/IDaoMap';
import {getServices} from './lib/IServiceMap';
import {getControllers} from './server/IControllerMap';

loglevel.setDefaultLevel('info');

const logger = loglevel.getLogger('api-main.ts');
logger.info('Starting Abc-Map API ...');

const main = async function(): Promise<any> {


    const daoMap = getDaoMap();
    const serviceMap = await getServices(daoMap);
    const controllerMap = getControllers(serviceMap);

    const config = new AbcApiConfig();
    const httpServer = new ApiServer(config, controllerMap);
    httpServer.start();

};

main().catch(error => {
    logger.error(error);
    process.exit(1);
});
开发者ID:remipassmoilesel,项目名称:Abcmap,代码行数:31,代码来源:api-main.ts


示例4:

// Exports when using this module as a dependency.

// Expose the loglevel api.
import * as loglevel from 'loglevel';
export let setLogLevel = loglevel.getLogger('webdriver-manager').setLevel;

// Export commands used in the cli.
export {clean} from './cmds/clean';
// Options that are used by the exported commands.
export {Options} from './cmds/options';
export {shutdown} from './cmds/shutdown';
export {start} from './cmds/start';
export {status} from './cmds/status';
export {update} from './cmds/update';
export {ChromeDriver} from './provider/chromedriver';
export {GeckoDriver} from './provider/geckodriver';
export {IEDriver} from './provider/iedriver';
export {ProviderConfig, ProviderInterface} from './provider/provider';
export {SeleniumServer} from './provider/selenium_server';
开发者ID:angular,项目名称:webdriver-manager,代码行数:19,代码来源:index.ts


示例5: startServerFromDotEnsimeCP

import * as Promise from 'bluebird'
import {ChildProcess} from 'child_process'
import * as fs from 'fs'
import * as _ from 'lodash'
import * as loglevel from 'loglevel'
import * as path from 'path'
import {DotEnsime} from '../types'
import {startServerFromClasspath} from './server-startup-utils'

const log = loglevel.getLogger('ensime.startup')

// Start ensime server from given classpath file
export function startServerFromDotEnsimeCP(
    dotEnsime: DotEnsime,
    ensimeServerFlags = ''
): PromiseLike<ChildProcess> {
    log.info('Starting server from classpath')
    return startServerFromClasspath(dotEnsime.serverJars.concat(dotEnsime.compilerJars), dotEnsime, ensimeServerFlags)
}

export function startServerFromAssemblyJar(
    assemblyJar: string,
    dotEnsime: DotEnsime,
    ensimeServerFlags = ''): PromiseLike<ChildProcess> {
    const cp = [assemblyJar].concat(dotEnsime.compilerJars)
    log.info('Starting server from assembly jar')
    return startServerFromClasspath(cp, dotEnsime, ensimeServerFlags)
}
开发者ID:ensime,项目名称:ensime-node,代码行数:28,代码来源:index.ts


示例6: createConnection

import * as net from 'net';
import * as path from 'path';
import * as loglevel from 'loglevel';
const log = loglevel.getLogger('ensime.client')
import * as Promise from 'bluebird'
import {WebsocketClient} from '../network/NetworkClient'
import {Typehinted} from '../server-api/server-protocol'


/**
 * A running and connected ensime client
 * 
 * low-level api
 */
export interface ServerConnection {
    destroy: () => void
    
    httpPort: string
    /**
     * Post a msg object 
     */
    post: (msg: any) => PromiseLike<Typehinted>
}

export function createConnection(httpPort: string, generalMsgHandler, serverVersion, serverPid = undefined): PromiseLike<ServerConnection> {
    const deferredConnection = Promise.defer<ServerConnection>();

    const callbackMap : {[callId: string]: Promise.Resolver<any>} = { }
    let ensimeMessageCounter = 1
    
    function handleIncoming(msg) {
开发者ID:hedefalk,项目名称:ensime-node,代码行数:31,代码来源:server-connection.ts


示例7: SeleniumServer

import * as http from 'http';
import * as loglevel from 'loglevel';
import * as os from 'os';
import * as path from 'path';
import * as rimraf from 'rimraf';

import {findPort} from '../../spec/support/helpers/port_finder';
import {ChromeDriver} from '../provider/chromedriver';
import {SeleniumServer} from '../provider/selenium_server';

import {OptionsBinary} from './options_binary';
import {shutdownBinary} from './shutdown';
import {startBinary} from './start';
import {updateBinary} from './update';

const log = loglevel.getLogger('webdriver-manager-test');
log.setLevel('debug');
loglevel.getLogger('webdriver-manager').setLevel('info');
const tmpDir = path.resolve(os.tmpdir(), 'test');
const selenium =
    new SeleniumServer({outDir: tmpDir, runAsDetach: true, runAsNode: true});

const optionsBinary: OptionsBinary = {
  outDir: tmpDir,
  browserDrivers: [{binary: new ChromeDriver({outDir: tmpDir})}],
  server: {binary: selenium, runAsDetach: true, runAsNode: true}
};
let port: number;

describe('start and stop cmd', () => {
  const origTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
开发者ID:angular,项目名称:webdriver-manager,代码行数:31,代码来源:start_stop.spec-int.ts


示例8: getLogger

 .catch(reason => {
   getLogger('socko').error(reason.message)
 })
开发者ID:dploeger,项目名称:socko,代码行数:3,代码来源:index.ts


示例9: new

 public static new(title: string): loglevel.Logger {
   return loglevel.getLogger(title);
 }
开发者ID:remipassmoilesel,项目名称:Abcmap,代码行数:3,代码来源:LoggerFactory.ts


示例10: 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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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