當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript sails.log類代碼示例

本文整理匯總了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();
     }
 });
開發者ID:bahout,項目名稱:collectortoqueue,代碼行數:9,代碼來源:producer.ts

示例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;
 };
開發者ID:bahout,項目名稱:collectortoqueue,代碼行數:12,代碼來源:consumer.ts

示例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');
            })


        });
開發者ID:bahout,項目名稱:collectortoqueue,代碼行數:48,代碼來源:remover.ts

示例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;
                };


            });
開發者ID:bahout,項目名稱:collectortoqueue,代碼行數:24,代碼來源:consumer.ts


注:本文中的sails.log類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。