本文整理汇总了TypeScript中loglevel.setDefaultLevel函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setDefaultLevel函数的具体用法?TypeScript setDefaultLevel怎么用?TypeScript setDefaultLevel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setDefaultLevel函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: 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
示例3: 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
示例4: enableProdMode
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import log from 'loglevel';
if (environment.production) {
enableProdMode();
}
log.setDefaultLevel(log.levels.INFO);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
开发者ID:chipster,项目名称:chipster-web,代码行数:15,代码来源:main.ts
示例5:
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.setDefaultLevel(0);
moduleLog.setDefaultLevel('error');
moduleLog.setDefaultLevel('ERROR');
moduleLog.setDefaultLevel(moduleLog.levels.WARN);
moduleLog.enableAll(false);
moduleLog.enableAll();
moduleLog.disableAll(true);
moduleLog.disableAll();
const logLevel = moduleLog.getLevel();
const testLogger: moduleLog.Logger = moduleLog.getLogger('TestLogger');
testLogger.setDefaultLevel(logLevel);
testLogger.setLevel(logLevel);
开发者ID:AbraaoAlves,项目名称:DefinitelyTyped,代码行数:31,代码来源:loglevel-tests.ts
注:本文中的loglevel.setDefaultLevel函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论