本文整理匯總了TypeScript中sails.log類的典型用法代碼示例。如果您正苦於以下問題:TypeScript log類的具體用法?TypeScript log怎麽用?TypeScript log使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了log類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
kue.Job.get(id, function (err, job) {
if (err) {
console.log(err)
}
if (job) {
sails.log.info(new Date(), " Removing completed job: ", job.type, job.data,job.id);
job.remove();
}
});
示例2: _getConcurrency
//local function
function _getConcurrency(params, def) {
try {
var producer = options[name] || {};
//default concurrency
var concurrency = producer[params] || def;
}
catch (e) {
sails.log.error('error in consumer.ts', e)
}
return concurrency;
};
示例3: function
}, function (err, app) {
sails.log.info("Kue remove");
var kue_engine = sails.config.kue;
//register kue.
/* kueHelper.removeAll('Getinfofromurl', kue, 'inactive');
kueHelper.removeAll('Getinfofromurl', kue, 'complete');
kueHelper.removeAll('Getinfofromurl', kue, 'active');
kueHelper.removeAll('findwebsite', kue, 'inactive');
kueHelper.removeAll('findwebsite', kue, 'active');
kueHelper.removeAll('Findwebsite', kue, 'inactive');
kueHelper.removeAll('Findwebsite', kue, 'active');
kueHelper.removeAll('Findwebsite', kue, 'inactive');
kueHelper.removeAll('Findwebsite', kue, 'complete');
kueHelper.removeAll('findwebsite', kue, 'complete');
*/
/* kueHelper.removeAll('Users', kue, 'active');
kueHelper.removeAll('Users', kue, 'inactive');
kueHelper.removeAll('Users', kue, 'complete');
kueHelper.removeAll('User', kue, 'active');
kueHelper.removeAll('User', kue, 'inactive');
kueHelper.removeAll('User', kue, 'complete');*/
/* kueHelper.removeAll('Users2', kue, 'active');
kueHelper.removeAll('Users2', kue, 'inactive');
kueHelper.removeAll('Users2', kue, 'complete');*/
/* kueHelper.removeAll('Findwebsite2', kue, 'active');
kueHelper.removeAll('Findwebsite2', kue, 'inactive');
kueHelper.removeAll('Findwebsite2', kue, 'complete');
*/
_.forEach(options, function (option) {
kueHelper.removeAll(option.kueName, kue, 'active');
kueHelper.removeAll(option.kueName, kue, 'inactive');
kueHelper.removeAll(option.kueName, kue, 'complete');
kueHelper.removeAll(option.kueName, kue, 'failed');
})
});
示例4: function
_.forEach(jobs, function (job, name) {
//console.log('job==>', job, 'name==>', name);
sails.log.info("Registering kue handler: " + name);
//todo to improve concurrency we should get value from job config
var concurrency = _getConcurrency('concurrency', 2);
kue_engine.process(name, concurrency, job);
//local function
function _getConcurrency(params, def) {
try {
var producer = options[name] || {};
//default concurrency
var concurrency = producer[params] || def;
}
catch (e) {
sails.log.error('error in consumer.ts', e)
}
return concurrency;
};
});