function benchWinstonDeepObj (cb) { for (var i = 0; i < max; i++) { chill.log(deep)
function benchWinstonInterpolate (cb) { for (var i = 0; i < max; i++) { chill.log('info', 'hello %s', 'world') chill.log('info', 'hello %s %j %d', 'world', { obj: true }, 4) function benchWinstonInterpolateExtra (cb) { for (var i = 0; i < max; i++) { chill.log('info', 'hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' }) function benchWinstonInterpolateDeep (cb) { for (var i = 0; i < max; i++) { chill.log('info', 'hello %j', deep)
function benchWinston (cb) { for (var i = 0; i < max; i++) { chill.log('info', 'hello world')
/** * Proxy to winston.log using the predefined level. * * @param {Mixed} ...args Info to log and any optional metadata. * @returns {Log} fluent interface. * @public */ log(...args) { this.winston.log(this.level, ...args); return this; }
redisClient.on('message', function(channel, response) { try { const { topic, event, payload, ref } = JSON.parse(response) logger.log('info', `Topic: ${topic} Event: ${event} ID: ${ref}`) io.to(topic).emit(channel, { topic, event, payload, ref, channel }) } catch (err) { logger.log('error', JSON.stringify(err)) } })
let setupWinston = () => { logger.level = _.findKey(logger.levels, (o) => { return o === program.verbose }) logger.level = logger.level || 'error' logger.log('debug', `RCRACK_PATH: ${process.env.RCRACK_PATH}`) }
coinList.forEach(function(coinItem){ if (ObjectUtils.isNonEmptyObject(coinItem)) { arrayLog.push(coinItem.symbol); arrayLog.push(coinItem); client.hset("coins", coinItem.symbol, JSON.stringify(coinItem), function (err, response) { if (err) { logger.log({"level": "error", "message": JSON.stringify(err)}); } }); } });
createKeySpace().then(function(createKeySpaceResponse) { logger.log({"level": "info", "message": "create table request submitted"}); createCoinDailyHistoryTable(); createCoinWeeklyHistoryTable(); createCoinYearlyHistoryTable(); createCoinSocialTable(); createCoinSnapshotTable(); createExchangeMarketDetailTable(); createTokenExchangeListTable(); createExchangeOHLCVTable(); });
app.listen(config.api.port, function () { let port = server.address().port; logger.log({ level: 'info', message: `MOBCON API is listening at port ${port}` }); })
MySQL.sequelize .sync() .then(() => { app.listen(PORT, () => logger.info(`App running at http://localhost:${PORT}`)); }) .catch(err => logger.log('error', err));
let lookupChecksum = (checksum) => { console.log(`Looking up activation bytes for checksum: ${checksum}`) console.log(`This might take a moment ...`) return rcrack(checksum) .then((output) => { logger.log('info', output.toString()) let matches = output.toString().match(/hex:([a-fA-F0-9]{8})/) if (!matches) throw new Error('Activation Bytes where not found!') console.log('Activation Bytes found:', matches[1]) }) }
/** * Error handler to make sure page is getting closed. */ app.on('error', (error, context) => { const { page } = context.state; if (page) { page.close(); } logger.log('error', error.message); });
setInterval(function(){ try { startCoinGraphCron(); } catch(e) { logger.log({level: "error", message: "caught exception " + e + " retry in "+FETCH_COIN_LOOP+" ms"}) } }, FETCH_COIN_LOOP);
/** * Proxy to winston.log using the predefined level. * * @param {Mixed} ...args Info to log and any optional metadata. * @returns {Log} fluent interface. * @public */ log(...args) { this.winston.log(this.level, ...args); return this; }