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


TypeScript npmlog.warn函数代码示例

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


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

示例1:

const _parseErr = (err, res) => {
  if (err) {
    log.warn('V8 error: ', err);
    return 'V8 Error';
  }
  log.warn('V8 ' + res.request.href + ' Returned Status: ' + res.statusCode);
  return 'Error querying the blockchain';
};
开发者ID:bitpay,项目名称:bitcore,代码行数:8,代码来源:v8.ts

示例2:

          _.map(preferences, (p) => {
            if (!p.email || usedEmails[p.email]) return;

            usedEmails[p.email] = true;
            if (notification.creatorId == p.copayerId && !emailType.notifyDoer)
              return;
            if (
              notification.creatorId != p.copayerId &&
              !emailType.notifyOthers
            )
              return;
            if (!_.includes(this.availableLanguages, p.language)) {
              if (p.language) {
                log.warn(
                  'Language for email "' + p.language + '" not available.'
                );
              }
              p.language = this.defaultLanguage;
            }

            let unit;
            if (wallet.coin != Defaults.COIN) {
              unit = wallet.coin;
            } else {
              unit = p.unit || this.defaultUnit;
            }

            return {
              copayerId: p.copayerId,
              emailAddress: p.email,
              language: p.language,
              unit
            };
          })
开发者ID:bitpay,项目名称:bitcore,代码行数:34,代码来源:emailservice.ts

示例3:

 const logDeprecated = (req) => {
   log.warn(
     'DEPRECATED',
     req.method,
     req.url,
     '(' + req.header('x-client-version') + ')'
   );
 };
开发者ID:matiu,项目名称:bitcore,代码行数:8,代码来源:expressapp.ts

示例4: catch

      .catch(err => {
        let errStr;
        try { errStr = err.toString().substr(0, 100); } catch (e) { }

        log.warn(
          'An error occurred when trying to send email to ' + email.to,
          errStr || err
        );
        return cb(err);
      });
开发者ID:bitpay,项目名称:bitcore,代码行数:10,代码来源:emailservice.ts

示例5: next

 this._retrieve(provider, (err, res) => {
   if (err) {
     log.warn('Error retrieving data for ' + provider.name, err);
     return next();
   }
   this.storage.storeFiatRate(provider.name, res, (err) => {
     if (err) {
       log.warn('Error storing data for ' + provider.name, err);
     }
     return next();
   });
 });
开发者ID:matiu,项目名称:bitcore,代码行数:12,代码来源:fiatrateservice.ts

示例6: test

test('request', (t) => {
  t.plan(1);
  npmlog.level = 'silly';
  npmlog.silly('silly prefix', 'x = %j', {foo:{bar:'baz'}});
  npmlog.verbose('verbose prefix', 'x = %j', {foo:{bar:'baz'}});
  npmlog.info('info prefix', 'x = %j', {foo:{bar:'baz'}});
  npmlog.http('http prefix', 'x = %j', {foo:{bar:'baz'}});
  npmlog.warn('warn prefix', 'x = %j', {foo:{bar:'baz'}});
  npmlog.error('error prefix', 'x = %j', {foo:{bar:'baz'}});
  npmlog.silent('silent prefix', 'x = %j', {foo:{bar:'baz'}});

  t.deepEqual(result.join('').trim(), resultExpect.join('').trim(), 'result');
});
开发者ID:demurgos,项目名称:typed-npmlog,代码行数:13,代码来源:test.ts

示例7:

          _.map(preferences, (p) => {
            if (!_.includes(this.availableLanguages, p.language)) {
              if (p.language)
                log.warn(
                  'Language for notifications "' +
                  p.language +
                  '" not available.'
                );
              p.language = this.defaultLanguage;
            }

            return {
              copayerId: p.copayerId,
              language: p.language,
              unit: unit || p.unit || this.defaultUnit
            };
          })
开发者ID:bitpay,项目名称:bitcore,代码行数:17,代码来源:pushnotificationsservice.ts

示例8: icb

          .then(ret => {
            try {
              ret = JSON.parse(ret);

              // only process right responses.
              if (!_.isUndefined(ret.blocks) && ret.blocks != x) {
                log.info(`Ignoring response for ${x}:` + JSON.stringify(ret));
                return icb();
              }

              result[x] = ret.feerate;
            } catch (e) {
              log.warn('fee error:', e);
            }

            return icb();
          })
开发者ID:bitpay,项目名称:bitcore,代码行数:17,代码来源:v8.ts


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