Built motion from commit ae138b72.|2.6.28
[motion2.git] / server / utils / loggers.js
index d237ccb..ad28a89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe18b=['level','toUpperCase','}}}','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','Console','warn','%s-%s','error','File','consoleLogger','path','util','winston','debugLevel','toLowerCase','info','redBG\x20white','red','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','%s-%s.log','message','replace','{{{','format'];(function(_0x3fe50c,_0x8add0d){var _0xe49479=function(_0x4224cc){while(--_0x4224cc){_0x3fe50c['push'](_0x3fe50c['shift']());}};_0xe49479(++_0x8add0d);}(_0xe18b,0x104));var _0xbe18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe18b[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xbe18('0x0'));var util=require(_0xbe18('0x1'));var moment=require('moment');var winston=require(_0xbe18('0x2'));var config=require('../config/environment');var debugLevel=config[_0xbe18('0x3')]?config['debugLevel'][_0xbe18('0x4')]():_0xbe18('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xbe18('0x6'),'error':_0xbe18('0x7'),'warn':'bold\x20yellow','info':_0xbe18('0x8'),'print':_0xbe18('0x9'),'success':_0xbe18('0xa'),'http':'gray','verbose':_0xbe18('0xb'),'debug':'bold\x20blue','silly':_0xbe18('0xc')};winston[_0xbe18('0xd')](XC_LOG_COLORS);function getLogFileName(_0xd22a77,_0x53a485,_0x47e3e6){var _0x3fbb7b=_0xd22a77||_0xbe18('0xe');return path['join'](_0x3fbb7b,util['format'](_0xbe18('0xf'),_0x53a485,_0x47e3e6));}function formatter(_0x58ed9c,_0x5e5b5e){_0x5e5b5e[_0xbe18('0x10')]=_0x5e5b5e['message'][_0xbe18('0x11')](/@@{/g,_0xbe18('0x12'))[_0xbe18('0x11')](/}@@/g,'}}}')[_0xbe18('0x11')](/@{/g,'{{')[_0xbe18('0x11')](/}@/g,'}}');return util[_0xbe18('0x13')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xbe18('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),_0x5e5b5e[_0xbe18('0x14')][_0xbe18('0x15')](),_0x58ed9c,_0x5e5b5e[_0xbe18('0x10')]);}function fileFormat(_0x16103f,_0x4ba569){_0x4ba569[_0xbe18('0x10')]=_0x4ba569['message'][_0xbe18('0x11')](/@@{/g,_0xbe18('0x12'))['replace'](/}@@/g,_0xbe18('0x16'))['replace'](/@{/g,'{{')[_0xbe18('0x11')](/}@/g,'}}');var _0x584472=_0x4ba569[_0xbe18('0x17')]&&Object['keys'](_0x4ba569[_0xbe18('0x17')])[_0xbe18('0x18')]?'\x0a\x09'+JSON['stringify'](_0x4ba569[_0xbe18('0x17')]):'';return util[_0xbe18('0x13')](_0xbe18('0x19'),moment()['format'](_0xbe18('0x1a')),_0x4ba569['level']['toUpperCase'](),_0x16103f,_0x4ba569[_0xbe18('0x10')],_0x584472);}function consoleLogger(){var _0x21235f=new winston[(_0xbe18('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xbe18('0x1c'))][(_0xbe18('0x1d'))]({'level':_0xbe18('0x1e'),'json':![],'formatter':function(_0x2cf124){return formatter('',_0x2cf124);}})]});return _0x21235f;}function fileLogger(_0x308f0c,_0x6b39c){var _0x1e286c=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xbe18('0x1c'))]['File']({'name':util['format'](_0xbe18('0x1f'),_0x308f0c,_0xbe18('0x20')),'filename':getLogFileName(_0x6b39c,_0x308f0c,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x15352f){return fileFormat(_0x308f0c,_0x15352f);}}),new winston[(_0xbe18('0x1c'))][(_0xbe18('0x21'))]({'name':util['format'](_0xbe18('0x1f'),_0x308f0c,debugLevel),'filename':getLogFileName(_0x6b39c,_0x308f0c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x24d039){return fileFormat(_0x308f0c,_0x24d039);}}),new winston[(_0xbe18('0x1c'))][(_0xbe18('0x1d'))]({'level':'warn','json':![],'formatter':function(_0x5e04b5){return fileFormat(_0x308f0c,_0x5e04b5);}})]});return _0x1e286c;}exports[_0xbe18('0x22')]=consoleLogger;exports['fileLogger']=fileLogger;
\ No newline at end of file
+var _0x8f27=['bold\x20blue','/var/log/xcally','format','%s-%s.log','message','{{{','}}}','replace','YYYY-MM-DD\x20HH:mm:ss','level','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','transports','Console','Logger','%s-%s','error','File','warn','consoleLogger','fileLogger','moment','winston','debugLevel','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta'];(function(_0x3d5cd9,_0x16db35){var _0x116080=function(_0x4c80fc){while(--_0x4c80fc){_0x3d5cd9['push'](_0x3d5cd9['shift']());}};_0x116080(++_0x16db35);}(_0x8f27,0x9b));var _0x78f2=function(_0x36b444,_0x505b35){_0x36b444=_0x36b444-0x0;var _0x786323=_0x8f27[_0x36b444];return _0x786323;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x78f2('0x0'));var winston=require(_0x78f2('0x1'));var config=require('../config/environment');var debugLevel=config[_0x78f2('0x2')]?config[_0x78f2('0x2')]['toLowerCase']():_0x78f2('0x3');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x78f2('0x4'),'warn':_0x78f2('0x5'),'info':_0x78f2('0x6'),'print':_0x78f2('0x7'),'success':_0x78f2('0x8'),'http':'gray','verbose':_0x78f2('0x9'),'debug':_0x78f2('0xa'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x25b764,_0x101d83,_0x36a2a9){var _0x2a2c44=_0x25b764||_0x78f2('0xb');return path['join'](_0x2a2c44,util[_0x78f2('0xc')](_0x78f2('0xd'),_0x101d83,_0x36a2a9));}function formatter(_0x4839d9,_0x15e6e7){_0x15e6e7[_0x78f2('0xe')]=_0x15e6e7[_0x78f2('0xe')]['replace'](/@@{/g,_0x78f2('0xf'))['replace'](/}@@/g,_0x78f2('0x10'))[_0x78f2('0x11')](/@{/g,'{{')[_0x78f2('0x11')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x78f2('0xc')](_0x78f2('0x12')),_0x15e6e7[_0x78f2('0x13')]['toUpperCase'](),_0x4839d9,_0x15e6e7['message']);}function fileFormat(_0x56b6bd,_0x109957){_0x109957[_0x78f2('0xe')]=_0x109957[_0x78f2('0xe')][_0x78f2('0x11')](/@@{/g,_0x78f2('0xf'))['replace'](/}@@/g,'}}}')[_0x78f2('0x11')](/@{/g,'{{')[_0x78f2('0x11')](/}@/g,'}}');var _0x4a5be0=_0x109957['meta']&&Object['keys'](_0x109957[_0x78f2('0x14')])[_0x78f2('0x15')]?'\x0a\x09'+JSON['stringify'](_0x109957[_0x78f2('0x14')]):'';return util[_0x78f2('0xc')](_0x78f2('0x16'),moment()['format'](_0x78f2('0x12')),_0x109957[_0x78f2('0x13')][_0x78f2('0x17')](),_0x56b6bd,_0x109957[_0x78f2('0xe')],_0x4a5be0);}function consoleLogger(){var _0x14c76d=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x78f2('0x18'))][(_0x78f2('0x19'))]({'level':'warn','json':![],'formatter':function(_0x41fa2f){return formatter('',_0x41fa2f);}})]});return _0x14c76d;}function fileLogger(_0x3ba9c9,_0x3cc542){var _0x35e178=new winston[(_0x78f2('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util['format'](_0x78f2('0x1b'),_0x3ba9c9,'error'),'filename':getLogFileName(_0x3cc542,_0x3ba9c9,_0x78f2('0x1c')),'level':_0x78f2('0x1c'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1bd6e2){return fileFormat(_0x3ba9c9,_0x1bd6e2);}}),new winston[(_0x78f2('0x18'))][(_0x78f2('0x1d'))]({'name':util[_0x78f2('0xc')](_0x78f2('0x1b'),_0x3ba9c9,debugLevel),'filename':getLogFileName(_0x3cc542,_0x3ba9c9,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4702eb){return fileFormat(_0x3ba9c9,_0x4702eb);}}),new winston['transports'][(_0x78f2('0x19'))]({'level':_0x78f2('0x1e'),'json':![],'formatter':function(_0x32b9ec){return fileFormat(_0x3ba9c9,_0x32b9ec);}})]});return _0x35e178;}exports[_0x78f2('0x1f')]=consoleLogger;exports[_0x78f2('0x20')]=fileLogger;
\ No newline at end of file