本文整理汇总了TypeScript中npmlog.debug函数的典型用法代码示例。如果您正苦于以下问题:TypeScript debug函数的具体用法?TypeScript debug怎么用?TypeScript debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debug函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: next
this._makeRequest(notification, (err, response) => {
if (err) log.error(err);
if (response) {
log.debug('Request status: ', response.statusCode);
log.debug('Request message: ', response.statusMessage);
log.debug('Request body: ', response.request.body);
}
next();
});
开发者ID:bitpay,项目名称:bitcore,代码行数:9,代码来源:pushnotificationsservice.ts
示例2: return
this.storage.fetchNotifications(walletId, null, fromTs, (
err,
notifications
) => {
if (err) return next(err);
const alreadyNotified = _.some(notifications, (n) => {
return (
n.type == 'NewIncomingTx' && n.data && n.data.txid == data.txid
);
});
if (alreadyNotified) {
log.debug(
'The incoming tx ' + data.txid + ' was already notified'
);
return next();
}
const notification = Notification.create({
type: 'NewIncomingTx',
data: {
txid: data.txid,
address: out.address,
amount: out.amount
},
walletId
});
this._storeAndBroadcastNotification(notification, next);
});
开发者ID:bitpay,项目名称:bitcore,代码行数:29,代码来源:blockchainmonitor.ts
示例3: _retrieve
_retrieve(provider, cb) {
log.debug('Fetching data for ' + provider.name);
this.request.get(
{
url: provider.url,
json: true
},
(err, res, body) => {
if (err || !body) {
return cb(err);
}
log.debug('Data for ' + provider.name + ' fetched successfully');
if (!provider.parseFn) {
return cb(
new Error('No parse function for provider ' + provider.name)
);
}
const rates = provider.parseFn(body);
return cb(null, rates);
}
);
}
开发者ID:matiu,项目名称:bitcore,代码行数:25,代码来源:fiatrateservice.ts
示例4: _retrieve
_retrieve(provider, coin, cb) {
log.debug(`Fetching data for ${provider.name} / ${coin} `);
this.request.get(
{
url: provider.url + coin.toUpperCase(),
json: true
},
(err, res, body) => {
if (err || !body) {
return cb(err);
}
log.debug(`Data for ${provider.name} / ${coin} fetched successfully`);
if (!provider.parseFn) {
return cb(
new Error('No parse function for provider ' + provider.name)
);
}
try {
const rates = _.filter( provider.parseFn(body), (x) => fiatCodes[x.code] );
return cb(null, rates);
} catch (e) {
return cb(e);
}
}
);
}
开发者ID:bitpay,项目名称:bitcore,代码行数:28,代码来源:fiatrateservice.ts
示例5: next
this.storage.fetchAddressByCoin(coin, out.address, (
err,
address
) => {
if (err) {
log.error('Could not fetch addresses from the db');
return next(err);
}
if (!address || address.isChange) return next();
const walletId = address.walletId;
log.debug(
'Incoming tx for wallet ' +
walletId +
' [' +
out.amount +
'sat -> ' +
out.address +
']'
);
const fromTs = Date.now() - 24 * 3600 * 1000;
this.storage.fetchNotifications(walletId, null, fromTs, (
err,
notifications
) => {
if (err) return next(err);
const alreadyNotified = _.some(notifications, (n) => {
return (
n.type == 'NewIncomingTx' && n.data && n.data.txid == data.txid
);
});
if (alreadyNotified) {
log.debug(
'The incoming tx ' + data.txid + ' was already notified'
);
return next();
}
const notification = Notification.create({
type: 'NewIncomingTx',
data: {
txid: data.txid,
address: out.address,
amount: out.amount
},
walletId
});
this._storeAndBroadcastNotification(notification, next);
});
});
开发者ID:bitpay,项目名称:bitcore,代码行数:52,代码来源:blockchainmonitor.ts
示例6: _notifyNewBlock
_notifyNewBlock(coin, network, hash) {
log.debug(`New ${coin}/${network} block ${hash}`);
const notification = Notification.create({
type: 'NewBlock',
walletId: network, // use network name as wallet id for global notifications
data: {
hash,
coin,
network
}
});
this._storeAndBroadcastNotification(notification, () => { });
}
开发者ID:bitpay,项目名称:bitcore,代码行数:14,代码来源:blockchainmonitor.ts
示例7: cb
(err, res, body) => {
if (err || !body) {
return cb(err);
}
log.debug('Data for ' + provider.name + ' fetched successfully');
if (!provider.parseFn) {
return cb(
new Error('No parse function for provider ' + provider.name)
);
}
const rates = provider.parseFn(body);
return cb(null, rates);
}
开发者ID:matiu,项目名称:bitcore,代码行数:16,代码来源:fiatrateservice.ts
示例8: cb
(err, res, body) => {
if (err || !body) {
return cb(err);
}
log.debug(`Data for ${provider.name} / ${coin} fetched successfully`);
if (!provider.parseFn) {
return cb(
new Error('No parse function for provider ' + provider.name)
);
}
try {
const rates = _.filter( provider.parseFn(body), (x) => fiatCodes[x.code] );
return cb(null, rates);
} catch (e) {
return cb(e);
}
}
开发者ID:bitpay,项目名称:bitcore,代码行数:19,代码来源:fiatrateservice.ts
示例9:
async.each(subs, (sub: any) => {
log.debug('New tx confirmation ' + sub.txid);
sub.isActive = false;
this.storage.storeTxConfirmationSub(sub, (err) => {
if (err) return cb(err);
const notification = Notification.create({
type: 'TxConfirmation',
walletId: sub.walletId,
creatorId: sub.copayerId,
data: {
txid: sub.txid,
coin,
network
// TODO: amount
}
});
this._storeAndBroadcastNotification(notification, cb);
});
});
开发者ID:bitpay,项目名称:bitcore,代码行数:20,代码来源:blockchainmonitor.ts
示例10: setTimeout
this.storage.fetchTxByHash(data.txid, (err, txp) => {
if (err) {
log.error('Could not fetch tx from the db');
return;
}
if (!txp || txp.status != 'accepted') return;
const walletId = txp.walletId;
if (!processIt) {
log.debug(
'Detected broadcast ' +
data.txid +
' of an accepted txp [' +
txp.id +
'] for wallet ' +
walletId +
' [' +
txp.amount +
'sat ]'
);
return setTimeout(
this._handleThirdPartyBroadcasts.bind(
this,
coin,
network,
data,
true
),
20 * 1000
);
}
log.debug(
'Processing accepted txp [' +
txp.id +
'] for wallet ' +
walletId +
' [' +
txp.amount +
'sat ]'
);
txp.setBroadcasted();
this.storage.storeTx(this.walletId, txp, (err) => {
if (err) log.error('Could not save TX');
const args = {
txProposalId: txp.id,
txid: data.txid,
amount: txp.getTotalAmount()
};
const notification = Notification.create({
type: 'NewOutgoingTxByThirdParty',
data: args,
walletId
});
this._storeAndBroadcastNotification(notification);
});
});
开发者ID:bitpay,项目名称:bitcore,代码行数:62,代码来源:blockchainmonitor.ts
注:本文中的npmlog.debug函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论