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


TypeScript winston.LoggerInstance类代码示例

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


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

示例1: loggerConfig

function loggerConfig(): LoggerInstance {
    'use strict';

    // Log-Level wie bei npm: error, warn, info, verbose, debug, silly
    // https://github.com/winstonjs/winston/blob/master/docs/transports.md
    const logger: LoggerInstance = new (Logger)({
        transports: [
            new (transports.Console)(LOG_OPTIONS.console),
            new (transports.File)(LOG_OPTIONS.file)
        ]
    });

    logger.info('Logging durch Winston ist konfiguriert');
    return logger;
}
开发者ID:AdrianFoell,项目名称:VP,代码行数:15,代码来源:logger.ts

示例2: init

  async init(): Promise<boolean> {
    this.logger.info('Initializing Game Handler Service Start');

    this.logger.info('Initializing Game Handler Service End');

    return true;
  }
开发者ID:cuponthetop,项目名称:bg-hub,代码行数:7,代码来源:game-handler.service.ts

示例3: init

  async init(): Promise<boolean> {
    this.logger.info('Initializing Locale Command Start');

    await this.db.createTable(COMMON_TABLES.LOCALE, false);

    this.logger.info('Initializing Locale Command End');

    return true;
  }
开发者ID:cuponthetop,项目名称:bg-hub,代码行数:9,代码来源:locale.command.ts

示例4: catch

 this.redisClient.brpoplpush('incoming', 'working', 0).then((jobMessage: string) => {
     this.logger.debug(`Message received from Redis server: ${jobMessage}`);
     try {
         this.ocrProcessingService.process(jobMessage);
     } catch (e) {
         this.logger.error(`${e.message}: ${e.stack}`);
     }
     this.redisClient.lrem('working', 1, jobMessage).then(() => { this.loop(); });
 });
开发者ID:janis91,项目名称:ocr,代码行数:9,代码来源:worker.ts

示例5: init

  async init(): Promise<boolean> {
    this.logger.info('Initializing Game Command Start');

    await this.db.createTable(GAME_TABLES.GAME, false);
    await this.db.createTable(GAME_TABLES.RELATION, false);

    this.logger.info('Initializing Game Command End');

    return true;
  }
开发者ID:cuponthetop,项目名称:bg-hub,代码行数:10,代码来源:game.command.ts

示例6: init

  async init(): Promise<boolean> {
    this.logger.info('Initializing User Command Start');

    await this.db.createTable(USER_TABLES.USER, false);
    await this.db.createTable(USER_TABLES.HISTORY, false);
    await this.db.createTable(USER_TABLES.RESULT, false);
    await this.db.createTable(USER_TABLES.GROUP, false);
    await this.db.createTable(USER_TABLES.GAME_LIST, false);
    await this.db.createTable(USER_TABLES.GROUP_MEMBER, false);

    this.logger.info('Initializing User Command End');

    return true;
  }
开发者ID:cuponthetop,项目名称:bg-hub,代码行数:14,代码来源:user.command.ts

示例7: constructor

 /**
  * The constructor.
  */
 constructor() {
     this.logger = LoggerUtil.build();
     this.ocrProcessingService = OcrProcessingServiceFactory.build();
     this.redisClient = RedisClientFactory.build();
     this.logger.info(`Application "OCR worker" initialized.`);
     this.registerProcessTerminationEvent();
 }
开发者ID:janis91,项目名称:ocr,代码行数:10,代码来源:worker.ts

示例8: addMemberToGroup

  async addMemberToGroup(uid: number, groupid: number): Promise<void> {
    let input: GroupMemberRow = new GroupMemberRow(groupid, uid);

    let result = await this.db.table(USER_TABLES.GROUP_MEMBER.name).insert(input);

    this.logger.info(JSON.stringify(result));
    return;
  }
开发者ID:cuponthetop,项目名称:bg-hub,代码行数:8,代码来源:user.command.ts

示例9: removeMemberFromGroup

  async removeMemberFromGroup(uid: number, groupid: number): Promise<void> {
    let result = await this.db.table(USER_TABLES.GROUP_MEMBER.name).delete().where({
      [USER_TABLES.GROUP_MEMBER.schema.id]: groupid,
      [USER_TABLES.GROUP_MEMBER.schema.member]: uid
    });

    this.logger.info(JSON.stringify(result));
    return;
  }
开发者ID:cuponthetop,项目名称:bg-hub,代码行数:9,代码来源:user.command.ts


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