本文整理汇总了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';
};
示例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
};
})
示例3:
const logDeprecated = (req) => {
log.warn(
'DEPRECATED',
req.method,
req.url,
'(' + req.header('x-client-version') + ')'
);
};
示例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);
});
示例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();
});
});
示例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');
});
示例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
};
})
示例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();
})