當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。