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