本文整理汇总了TypeScript中aurelia-framework.LogManager.getLogger方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LogManager.getLogger方法的具体用法?TypeScript LogManager.getLogger怎么用?TypeScript LogManager.getLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurelia-framework.LogManager
的用法示例。
在下文中一共展示了LogManager.getLogger方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: constructor
import {bindable, containerless, inject, LogManager} from 'aurelia-framework';
import {EventAggregator} from 'aurelia-event-aggregator';
import {ColumnDefinition} from './column-definition';
import {GridOptions} from './grid-options';
import {GridAction} from './grid-action';
let logger = LogManager.getLogger('grid');
@containerless()
@inject(EventAggregator)
export class Grid {
@bindable public data: any[];
@bindable public actions: GridAction[];
@bindable public options: GridOptions;
@bindable public selectedColumnId: number;
@bindable public selectedRowId: number;
@bindable public sortedColumnId: number;
@bindable public hoveredRowId: number;
@bindable public hoveredColumnId: number;
public columnDefinitions: ColumnDefinition[];
public enableInlineEditing: boolean;
public enableColumnSorting: boolean;
public rows: any[];
public sortDirection: string;
public hasIndividualColumnPerAction: boolean;
private _id: string;
private _eventAggregator: EventAggregator;
public constructor(eventAggregator: EventAggregator) {
示例4: configureRouter
import { LogManager } from 'aurelia-framework';
import { RouterConfiguration } from 'aurelia-router';
const logger = LogManager.getLogger('adventure');
export class Adventure {
configureRouter(config: RouterConfiguration): void {
logger.debug("configuring the router");
config.title = "SKG - Adventure";
config.map([
{ route: '', redirect: 'level-select' },
{ route: 'level-select', name: 'level-select', moduleId: 'level-select/level-select' }
]);
config.mapUnknownRoutes('level-select/level-select');
}
}
示例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');
}
}
示例6: getLogger
export function getLogger(moduleId: string): Logger {
return LogManager.getLogger(moduleId);
}
示例7: 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
示例8: 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);
示例9:
import {LogManager} from 'aurelia-framework';
export const log = LogManager.getLogger('jobsweb');
示例10: getLogger
/** Call this function to get an logger
*
* @param {string} name Provide a name for the logger
* @return {Logger}
*/
function getLogger(name: String): Logger {
return LogManager.getLogger(name);
}