当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript aurelia-logging.getLogger函数代码示例

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


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

示例1: isOverride

export function isOverride(key: string) {
  const val = key.charAt(0) === overrideMarker;

  getLogger('aurelia-json-schema-form')
    .info('isOverride', { key, val });
  return val;
}
开发者ID:jbockle,项目名称:aurelia-json-schema-form,代码行数:7,代码来源:form-override.ts

示例2: configure

export function configure(frameworkConfig: FrameworkConfiguration, callback?: (config: PluginOptions) => void) {
  const logger = getLogger('aurelia-json-schema-form');

  logger.info('initializing aurelia-json-schema-form');

  // create defaults/apply user defined configuration
  const options = new PluginOptions();
  if (callback instanceof Function) {
    callback(options);
  }

  registerLogger(logger, options, frameworkConfig);

  registerConfiguration(logger, options, frameworkConfig);

  (frameworkConfig.container.get(RulesFactory) as RulesFactory).register();

  frameworkConfig.globalResources([
    PLATFORM.moduleName('./form/au-json-schema-form'),
    PLATFORM.moduleName('./value-converters/sf-number-value-converter'),
    PLATFORM.moduleName('./value-converters/sf-array-can-remove-value-converter'),
    PLATFORM.moduleName('./value-converters/sf-boolean-is-read-only-value-converter'),
    PLATFORM.moduleName('./form/array/sf-array'),
    PLATFORM.moduleName('./form/object/sf-object'),
    PLATFORM.moduleName('./form/number/sf-number'),
    PLATFORM.moduleName('./form/text/sf-string'),
    PLATFORM.moduleName('./form/boolean/sf-boolean'),
    PLATFORM.moduleName('./templates/bootstrap4/bootstrap-tooltip')
  ]);
}
开发者ID:jbockle,项目名称:aurelia-json-schema-form,代码行数:30,代码来源:index.ts

示例3: patchViewResources

export function patchViewResources(viewResources: ViewResources) {
  const logger = LogManager.getLogger('templating');
  /**
   * from: https://github.com/aurelia/templating/blob/master/src/view-engine.js
   */
  ViewEngine.prototype.loadTemplateResources = function loadTemplateResources(registryEntry, compileInstruction, loadContext) {
    var resources = new ViewResources(this.appResources, registryEntry.address);
    
    // START PATCH
    // TODO: this should be done in a monkey-patched constructor of ViewResources
    if (!resources.lookupFunctions.bindingFunctions) Object.assign(resources.lookupFunctions, { bindingFunctions: resources.getBindingFunction.bind(resources) })
    if (!resources.bindingFunctions) resources.bindingFunctions = {}
    // END PATCH
  
    var dependencies = registryEntry.dependencies;
    var importIds = void 0;
    var names = void 0;

    compileInstruction = compileInstruction || ViewCompileInstruction.normal;

    if (dependencies.length === 0 && !compileInstruction.associatedModuleId) {
      return Promise.resolve(resources);
    }

    importIds = dependencies.map(function (x) {
      return x.src;
    });
    names = dependencies.map(function (x) {
      return x.name;
    });
    logger.debug('importing resources for ' + registryEntry.address, importIds);

    return this.importViewResources(importIds, names, resources, compileInstruction, loadContext);
  };
  
  /**
  * Registers a binding behavior.
  * @param name The name of the binding function.
  * @param bindingBehavior The binding function instance.
  */
  ViewResources.prototype.registerBindingFunction = function(name: string, bindingFunction: Object): void {
    register(this.bindingFunctions, name, bindingFunction, 'a BindingFunction')
  }
  
  /**
  * Gets a binding behavior.
  * @param name The name of the binding function.
  * @return The binding function instance.
  */
  ViewResources.prototype.getBindingFunction = function(name: string): Object {
    return this.bindingFunctions[name] || (this.hasParent ? this.parent.getBindingFunction(name) : null)
  }
  
  // patch global instance of ViewResources
  viewResources.bindingFunctions = {}
  Object.assign(viewResources.lookupFunctions, { bindingFunctions: viewResources.getBindingFunction.bind(viewResources) })
}
开发者ID:niieani,项目名称:aurelia-binding-functions,代码行数:57,代码来源:view-resources.ts

示例4: sanitize

  /**
   * Sanitizes the provided input.
   * @param input The input to be sanitized.
   */
  sanitize(input) {
    if (needsToWarn) {
      needsToWarn = false;

      getLogger('html-sanitizer')
        .warn(`CAUTION: The default HTMLSanitizer does NOT provide security against a wide variety of sophisticated XSS attacks,
and should not be relied on for sanitizing input from unknown sources.
Please see https://aurelia.io/docs/binding/basics#element-content for instructions on how to use a secure solution like DOMPurify or sanitize-html.`);
    }

    return input.replace(SCRIPT_REGEX, '');
  }
开发者ID:aurelia,项目名称:templating-resources,代码行数:16,代码来源:html-sanitizer.ts

示例5: setFormOverrides

export function setFormOverrides(
  form: IFormOverride, parentSchema: IJsonSchemaDefinition, formKey: string, schema: IJsonSchemaDefinition
) {
  getLogger('aurelia-json-schema-form')
    .info('setFormOverrides', { form, parentSchema, formKey, schema });
  schema.title = schema.title || (!!formKey ? fromCamelCase(formKey) : undefined);
  form.$schema = schema;
  if (form.$enum) {
    form.$schema.enum = Array.from(form.$enum.values());
  }

  if (parentSchema && parentSchema.type === 'object') {
    form.$required = form.$required || (parentSchema.required
      ? (parentSchema as IJsonSchemaObjectDefinition).required.indexOf(formKey) > -1 : false);
  }
}
开发者ID:jbockle,项目名称:aurelia-json-schema-form,代码行数:16,代码来源:form-override.ts

示例6: _createDynamicElement

export function _createDynamicElement({ name, viewUrl, bindableNames, useShadowDOMmode }: {
  name: string,
  viewUrl: string,
  bindableNames: string[],
  useShadowDOMmode: null | '' | 'open' | 'closed'
}): Function {
  @customElement(name)
  @useView(viewUrl)
  class DynamicElement {
    $parent: any;
    bind(bindingContext) {
      this.$parent = bindingContext;
    }
  }

  for (let i = 0, ii = bindableNames.length; i < ii; ++i) {
    bindable(bindableNames[i])(DynamicElement);
  }

  switch (useShadowDOMmode) {
  case 'open':
    useShadowDOM({ mode: 'open' })(DynamicElement);
    break;

  case 'closed':
    useShadowDOM({ mode: 'closed' })(DynamicElement);
    break;

  case '':
    useShadowDOM(DynamicElement);
    break;

  case null:
    // Do not use shadow dom
    break;

  default:
    getLogger('aurelia-html-only-element')
      .warn(`Expected 'use-shadow-dom' value to be "close", "open" or "", received ${useShadowDOMmode}`);
    break;
  }

  return DynamicElement;
}
开发者ID:aurelia,项目名称:templating-resources,代码行数:44,代码来源:dynamic-element.ts

示例7: constructor

 constructor(settings: core.Settings) {
     this._logger = LogManager.getLogger(settings.app.prefix);
 }
开发者ID:macinnir,项目名称:au-demos,代码行数:3,代码来源:log.module.ts

示例8: require

import { join } from 'path'
import { existsSync } from 'fs'
import ava from 'ava'
import bluebird = require('bluebird')
import { getLogger } from 'aurelia-logging'

import fixture from './index'

const cwd = process.cwd()
const logger = getLogger('fixture.spec')
logger.debug('starting fixture.spec')

const ftest = fixture(ava, join(process.env['PWD']!, 'fixtures/cases'))

ava('shape test', t => {
  t.truthy(ftest.failing)
  t.truthy(ftest.failing.only)
  t.truthy(ftest.failing.skip)
  t.truthy(ftest.only)
  t.truthy(ftest.only.failing)
  t.truthy(ftest.skip)
  t.truthy(ftest.skip.failing)
})

ftest('abs path', 'case-1', (t, d) => {
  const localCwd = process.cwd()
  logger.debug('abs path, case-1')
  logger.debug(`outer cwd: ${cwd}`)
  logger.debug(`local cwd: ${localCwd}`)

  t.is(d.caseName, 'case-1')
开发者ID:unional,项目名称:ava-fixture,代码行数:31,代码来源:fixture.spec.ts

示例9: getLogger

import Order from 'assert-order'
import { getLogger } from 'aurelia-logging'
import ava from 'ava'
import { readdirSync } from 'fs'
import { resolve, join } from 'path'

import fixture from './index'

const log = getLogger('fixture.each.spec')
log.debug('starting fixture.each.spec')

const parent = resolve(process.cwd(), 'fixtures/cases')
const dirs = readdirSync(parent).toString().split(',')
const ctest = fixture(ava, 'fixtures/cases')
log.debug('fixture.each.spec loaded dirs')

ava('baseline and result must be specified together', t => {
  t.throws(() => (fixture as any)(ava, 'x', 'y'))
})

ava('shape', t => {
  t.not(ctest.each, undefined)
  t.not(ctest.each.failing, undefined)
  t.not(ctest.only.each, undefined)
  t.not(ctest.only.each.failing, undefined)
  t.not(ctest.skip.each, undefined)
  t.not(ctest.skip.each.failing, undefined)
})

const dirsCopy = [...dirs]
const order = new Order(dirs.length)
开发者ID:unional,项目名称:ava-fixture,代码行数:31,代码来源:fixture.each.spec.ts

示例10: constructor

 constructor(targetInstruction: any) {
     this.log = getLogger('aurelia-tree-view/tree-node-template');
     this.template = targetInstruction.elementInstruction.template;
     // this.log.debug(targetInstruction);
 }
开发者ID:Thanood,项目名称:aurelia-tree-view,代码行数:5,代码来源:tree-node-template.ts


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