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


TypeScript bunyan.info函数代码示例

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


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

示例1: onServerStart

        : app.listen(listen_port, () => {
            logger.info('%s listening at %s', app.name, app.url);

            if (onServerStart != null)
                return onServerStart(app.url, app, orms_out,
                    callback == null ? /* tslint:disable:no-empty*/ () => {} : callback
                );
            else if (callback != null)
                return callback(null, app, orms_out);
        });
开发者ID:SamuelMarks,项目名称:restify-utils,代码行数:10,代码来源:index.ts

示例2: start

  public start () {
    if (this.options.webhookProxy) {
      createWebhookProxy({
        logger,
        path: this.options.webhookPath,
        port: this.options.port,
        url: this.options.webhookProxy,
      })
    }

    this.server.listen(this.options.port)
    logger.info('Listening on http://localhost:' + this.options.port)
  }
开发者ID:brntbeer,项目名称:probot,代码行数:13,代码来源:index.ts

示例3: callback

    waterline_obj.initialize(orm.config, (err, ontology) => {
        if (err != null)
            return callback(err);
        else if (ontology == null || ontology.connections == null || ontology.collections == null
            || ontology.connections.length === 0 || ontology.collections.length === 0) {
            logger.error('waterline_obj.initialize::ontology =', ontology, ';');
            return callback(new TypeError('Expected ontology with connections & waterline_collections'));
        }

        // Tease out fully initialised models.
        logger.info('Waterline initialised with:\t', Object.keys(ontology.collections), ';');
        return callback(null, { connection: ontology.connections, collections: ontology.collections });
    });
开发者ID:SamuelMarks,项目名称:restify-utils,代码行数:13,代码来源:index.ts

示例4: program

const sequelizeHandler = (orm: {skip: boolean, uri?: string, config?: sequelize.Options, map: Map<string, any>},
                          logger: Logger, callback: (err, ...args) => void) => {
    if (orm.skip) return callback(void 0);

    logger.info('Sequelize initialising with:\t', Array.from(orm.map.keys()), ';');
    const sequelize_obj: sequelize.Sequelize = new sequelize['Sequelize'](orm.uri, orm.config);

    const entities = new Map<string, sequelize.Instance<{}> & sequelize.Model<{}, {}>>();
    for (const [entity, program] of orm.map)
        entities.set(entity, program(sequelize_obj, orm.map));

    sequelize_obj
        .authenticate()
        .then(() => map(
            Array.from(entities.keys()),
            (entity_name, cb) =>
                sequelize_obj
                    .sync(entities.get(entity_name) as any)
                    .then(_ => cb(void 0))
                    .catch(cb),
            err => callback(err, { connection: sequelize_obj, entities })
        ))
        .catch(callback);
};
开发者ID:SamuelMarks,项目名称:restify-utils,代码行数:24,代码来源:index.ts

示例5: tweetImage

export default async function tweetImage(logger: Logger) {
  try {
    const { fileName, file } = await getRandomPicture();

    const b64Picture = file.toString('base64');
    const uploadedPicture = await t.post('media/upload', {
      stringify_ids: true,
      media_data: b64Picture,
    });
    const mediaParams = {
      stringify_ids: true,
      // @ts-ignore
      media_id: uploadedPicture.data.media_id_string,
      alt_text,
    };

    await t.post('media/metadata/create', mediaParams);
    const tweet = await t.post('statuses/update', {
      stringify_ids: true,
      status: config.twitter.tweetMessage,
      // @ts-ignore
      media_ids: [uploadedPicture.data.media_id_string],
    });

    logger.info({
      status: config.twitter.tweetMessage,
      // @ts-ignore
      mediaIds: uploadedPicture.data.media_id_string,
      image: fileName,
      // @ts-ignore
      tweet: tweet.data.id_str,
    });
  } catch (e) {
    logger.error(e);
  }
}
开发者ID:marudor,项目名称:randomCats,代码行数:36,代码来源:twitter.ts


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