本文整理汇总了TypeScript中aurelia-framework.LogManager类的典型用法代码示例。如果您正苦于以下问题:TypeScript LogManager类的具体用法?TypeScript LogManager怎么用?TypeScript LogManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LogManager类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: addDebugLogging
export function addDebugLogging() {
const appenders = LogManager.getAppenders();
if (!appenders || !appenders.length) {
LogManager.setLevel(LogManager.logLevel.error);
LogManager.addAppender(new ConsoleAppender());
}
}
开发者ID:aurelia,项目名称:templating-router,代码行数:7,代码来源:shared.ts
示例2: configure
export function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
LogManager.setLevel(3);
aurelia.start().then(() => aurelia.setRoot("app/App"));
}
开发者ID:AWoelfel,项目名称:aurelia-npm-systemjs-skeleton,代码行数:9,代码来源:Application.ts
示例3: parseGridRow
private parseGridRow(element: any): GridRowAttributes {
// Pull any row attrs into a hash object
var rowsAttributes = new GridRowAttributes();
var rowElement = element.querySelector("grid-row");
if(!rowElement){
LogManager.getLogger("aurelia-grid").warn("Grid has no <grid-row> defined");
return rowsAttributes;
}
var attrs = Array.prototype.slice.call(rowElement.attributes);
attrs.forEach(a => rowsAttributes[a.name] = a.value);
return rowsAttributes;
}
开发者ID:Good-AureliaExamples,项目名称:aurelia-grid,代码行数:15,代码来源:grid-parser.ts
示例4: parseGridCols
private parseGridCols(element: any): GridColumn[] {
var rowElement = element.querySelector("grid-row");
if(!rowElement){
LogManager.getLogger("aurelia-grid").warn("Grid has no <grid-row> defined");
return [];
}
var columnElements = Array.prototype.slice.call(rowElement.querySelectorAll("grid-col"));
var cols = [];
var columnTemplate =
'<span class="grid-column-heading">${$column.heading}</span>' +
'<span if.bind="$column.sorting === \'desc\'" class="${$grid.icons.sortingDesc}"></span>' +
'<span if.bind="$column.sorting === \'asc\'" class="${$grid.icons.sortingAsc}"></span>';
// <grid-col can-sort="true" heading="header"> ..
// or <grid-col can-sort="true"><heading>header template</heading><template>cell template</template>
columnElements.forEach(c => {
var col = new GridColumn();
var attrs = Array.prototype.slice.call(c.attributes);
attrs.forEach(a => this.tryAssign(col, this.camelCaseName(a.name), a.value));
// check for inner <heading> of template
var headingTemplate = c.querySelector("heading");
col.headingTemplate = (headingTemplate && headingTemplate.innerHTML) ? headingTemplate.innerHTML : columnTemplate;
// check for inner content of <template> or use full content as template
var cellTemplate = c.querySelector("template");
col.template = (cellTemplate && cellTemplate.innerHTML) ? cellTemplate.innerHTML : c.innerHTML;
col.init();
cols.push(col);
});
return cols;
}
开发者ID:Good-AureliaExamples,项目名称:aurelia-grid,代码行数:36,代码来源:grid-parser.ts
示例5: configureRouter
import { LogManager } from 'aurelia-framework';
import { RouterConfiguration } from 'aurelia-router';
const logger = LogManager.getLogger('app');
export class App {
configureRouter(config: RouterConfiguration): void {
logger.debug("configuring the router");
config.title = "SKG";
config.map([
{ route: ['', 'home'], name: 'home', moduleId: 'home/home' },
{ route: 'online', name: 'online', moduleId: 'online/online' },
{ route: 'local', name: 'local', moduleId: 'local/local' },
{ route: 'adventure', name: 'adventure', moduleId: 'adventure/adventure' },
{ route: 'skynet', name: 'skynet', moduleId: 'aigame/aigame' }
]);
config.mapUnknownRoutes('home/home');
}
}
开发者ID:TylerLeite,项目名称:supa-kyapucha-gemu,代码行数:19,代码来源:app.ts
示例6: configure
import Cycle from '@cycle/rxjs-run'
import {Observable, Observer, Subscription, BehaviorSubject, ReplaySubject, Subject, Subscriber} from 'rxjs/Rx'
import { DriverFunction } from '@cycle/base'
import {LogManager, FrameworkConfiguration, declarePropertyDependencies, computedFrom, autoinject, Container} from 'aurelia-framework';
import {ViewEngineHooks, View, Controller} from 'aurelia-templating'
import {ContextChanges, ChangeOrigin, ChangeType} from './basic-bindings'
export {Observable, Observer, Subscription, BehaviorSubject, ReplaySubject, Subject} from 'rxjs/Rx'
export * from './basic-bindings'
const logger = LogManager.getLogger('aurelia-plugin-skeleton')
export function configure(frameworkConfig: FrameworkConfiguration) {
const viewResources = frameworkConfig.aurelia.resources
const diContainer = frameworkConfig.container
const hooks = {
beforeBind: function (view: View & {bindingContext; controller: Controller}) {
if (view.controller !== null) {
const context = view.controller.viewModel as any
if (!context || typeof context.cycle !== 'function') return
const count = context._cycleCount = (context._cycleCount || 0) + 1
if (context._cycleCount > 1) {
logger.error('would run the cycle more then once!', count)
return
}
const preparedSources = context.cycleDrivers || {}
const { drivers, onBind, onUnbind, dispose } = makeBindingDrivers(context, diContainer) //observerLocator, strategyLocator, signaler
开发者ID:niieani,项目名称:aurelia-cycle,代码行数:30,代码来源:index.ts
示例7: getLogger
export function getLogger(moduleId: string): Logger {
return LogManager.getLogger(moduleId);
}
开发者ID:SoftwareMasons,项目名称:aurelia-openiddict,代码行数:3,代码来源:getLogger.ts
示例8: constructor
constructor() {
this.logger = LogManager.getLogger('notification');
}
开发者ID:Thanood,项目名称:monterey,代码行数:3,代码来源:notification.ts
示例9: constructor
import {autoinject, LogManager} from 'aurelia-framework';
import {EventAggregator} from 'aurelia-event-aggregator';
import {NavigationInstruction, Router, RouterConfiguration} from 'aurelia-router';
import {AuthPlugin} from 'auth-plugin';
let logger = LogManager.getLogger('ROUTER');
@autoinject
export default class {
constructor(private router: Router, private eventAggregator: EventAggregator) {
}
prepare() {
if (this.router.isConfigured) {
return;
}
this.router.configure((config: RouterConfiguration) => {
config.title = 'Aurelia';
config.map([
{ route: ['', 'login'], name: 'login', moduleId: 'login' },
{ route: 'page1', name: 'page1', moduleId: 'page1', settings: { auth: true } },
{ route: 'page2', name: 'page2', moduleId: 'page2', settings: { auth: true } }
]);
config.addAuthorizeStep(AuthPlugin);
return config;
});
let callback = (eventArgs: Object, name) => {
logger.warn(eventArgs['instruction']['config']['name'], name);
开发者ID:codeaid,项目名称:skeleton-navigation,代码行数:31,代码来源:router-config.ts
示例10: configure
import {BindingFunction} from 'aurelia-binding-functions'
import {LogManager, FrameworkConfiguration} from 'aurelia-framework'
import {CallScope, Scope, getContextFor, Binding, Listener, Expression} from 'aurelia-binding'
import {View} from 'aurelia-templating'
import {sourceContext} from 'aurelia-binding'
// import {Observable, Observer, Subscription, ReplaySubject, BehaviorSubject, Subject} from 'rxjs/Rx'
const logger = LogManager.getLogger('aurelia-rxjs')
export function configure(frameworkConfig: FrameworkConfiguration) {
const viewResources = frameworkConfig.aurelia.resources
const bindingBehaviorInstance = frameworkConfig.container.get(ObservableSignalBindingBehavior)
viewResources.registerBindingBehavior('observableSignal', bindingBehaviorInstance)
const rxBindingFunctionInstance = frameworkConfig.container.get(RxBindingFunction)
if (typeof viewResources.registerBindingFunction === 'function') {
viewResources.registerBindingFunction('@rx', rxBindingFunctionInstance)
} else {
throw new Error('You need to load the aurelia-binding-functions plugin before aurelia-observable-binding-function.')
}
}
export class RxBindingFunction implements BindingFunction {
connect(callScope: CallScope, binding: Binding, scope: Scope) {
logger.debug('[connect] start connect for VALUE:', callScope.args[0].name)
const observable = callScope.args[0].evaluate(scope, binding.lookupFunctions, true) //as Subject<any | ChangeWithMetadata<any>>
if (observable && typeof observable.subscribe === 'function') {
// observe the underlying property to trigger when inner value changed (eg. if an array - observe its changes)
开发者ID:niieani,项目名称:aurelia-rxjs,代码行数:31,代码来源:index.ts
注:本文中的aurelia-framework.LogManager类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论