本文整理汇总了TypeScript中aurelia-framework.LogManager.addAppender方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LogManager.addAppender方法的具体用法?TypeScript LogManager.addAppender怎么用?TypeScript LogManager.addAppender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurelia-framework.LogManager
的用法示例。
在下文中一共展示了LogManager.addAppender方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: addDebugLogging
export function addDebugLogging() {
const appenders = LogManager.getAppenders();
if (!appenders || !appenders.length) {
LogManager.setLevel(LogManager.logLevel.error);
LogManager.addAppender(new ConsoleAppender());
}
}
示例2: ConsoleAppender
ďťżimport {LogManager} from 'aurelia-framework';
import {ConsoleAppender} from 'aurelia-logging-console';
LogManager.addAppender(new ConsoleAppender());
LogManager.setLevel(LogManager.logLevel.debug);
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
aurelia.start().then(() => aurelia.setRoot());
}
示例3: CustomLogAppender
import 'bootstrap';
import {Aurelia, ViewLocator, Origin} from 'aurelia-framework';
import * as str from 'string';
import {LogManager} from 'aurelia-framework';
import {CustomLogAppender} from './custom-log-appender';
LogManager.addAppender(new CustomLogAppender());
LogManager.setLevel(LogManager.logLevel.debug);
export function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
//Uncomment the line below to enable animation.
aurelia.use.plugin('aurelia-animator-css');
aurelia.use.plugin('aurelia-dialog');
//Anyone wanting to use HTMLImports to load views, will need to install the following plugin.
//aurelia.use.plugin('aurelia-html-import-template-loader')
//ViewLocator.prototype.convertOriginToViewUrl = (origin: Origin) => {
// var moduleId = origin.moduleId;
// var id = str(moduleId).endsWith('.js') || str(moduleId).endsWith('.ts') ? moduleId.substring(0, moduleId.length - 3) : moduleId;
// return id;
//}
aurelia.start().then(() => aurelia.setRoot());
}