Built motion from commit ac06311e.|2.6.28
[motion2.git] / server / utils / loggers.js
index 1918a7f..bdcf013 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c0c=['winston','../config/environment','debugLevel','toLowerCase','info','red','white','bold\x20white','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','Console','warn','Logger','File','%s-%s','error','consoleLogger','fileLogger','path','util'];(function(_0x35d74c,_0x2ccc08){var _0x100202=function(_0x4dff79){while(--_0x4dff79){_0x35d74c['push'](_0x35d74c['shift']());}};_0x100202(++_0x2ccc08);}(_0x4c0c,0x92));var _0xc4c0=function(_0x26d993,_0x559ddb){_0x26d993=_0x26d993-0x0;var _0x1807e0=_0x4c0c[_0x26d993];return _0x1807e0;};'use strict';var path=require(_0xc4c0('0x0'));var util=require(_0xc4c0('0x1'));var moment=require('moment');var winston=require(_0xc4c0('0x2'));var config=require(_0xc4c0('0x3'));var debugLevel=config[_0xc4c0('0x4')]?config[_0xc4c0('0x4')][_0xc4c0('0x5')]():_0xc4c0('0x6');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':_0xc4c0('0x7'),'warn':'bold\x20yellow','info':_0xc4c0('0x8'),'print':_0xc4c0('0x9'),'success':'bold\x20green','http':_0xc4c0('0xa'),'verbose':_0xc4c0('0xb'),'debug':_0xc4c0('0xc'),'silly':_0xc4c0('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x1307eb,_0x3c227f,_0x129ade){var _0x12b09c=_0x1307eb||_0xc4c0('0xe');return path[_0xc4c0('0xf')](_0x12b09c,util[_0xc4c0('0x10')](_0xc4c0('0x11'),_0x3c227f,_0x129ade));}function formatter(_0x22a15b,_0x11ab22){_0x11ab22[_0xc4c0('0x12')]=_0x11ab22[_0xc4c0('0x12')]['replace'](/@@{/g,'{{{')[_0xc4c0('0x13')](/}@@/g,'}}}')[_0xc4c0('0x13')](/@{/g,'{{')[_0xc4c0('0x13')](/}@/g,'}}');return util[_0xc4c0('0x10')](_0xc4c0('0x14'),moment()['format'](_0xc4c0('0x15')),_0x11ab22[_0xc4c0('0x16')][_0xc4c0('0x17')](),_0x22a15b,_0x11ab22['message']);}function fileFormat(_0x2673ef,_0x27e6aa){_0x27e6aa['message']=_0x27e6aa[_0xc4c0('0x12')][_0xc4c0('0x13')](/@@{/g,'{{{')[_0xc4c0('0x13')](/}@@/g,'}}}')[_0xc4c0('0x13')](/@{/g,'{{')[_0xc4c0('0x13')](/}@/g,'}}');var _0x4fda18=_0x27e6aa[_0xc4c0('0x18')]&&Object[_0xc4c0('0x19')](_0x27e6aa[_0xc4c0('0x18')])['length']?'\x0a\x09'+JSON[_0xc4c0('0x1a')](_0x27e6aa[_0xc4c0('0x18')]):'';return util[_0xc4c0('0x10')](_0xc4c0('0x1b'),moment()[_0xc4c0('0x10')](_0xc4c0('0x15')),_0x27e6aa[_0xc4c0('0x16')][_0xc4c0('0x17')](),_0x2673ef,_0x27e6aa[_0xc4c0('0x12')],_0x4fda18);}function consoleLogger(){var _0x434934=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc4c0('0x1c'))][(_0xc4c0('0x1d'))]({'level':_0xc4c0('0x1e'),'json':![],'formatter':function(_0x40f4da){return formatter('',_0x40f4da);}})]});return _0x434934;}function fileLogger(_0x56f3dd,_0x3e9a7a){var _0x4b76fd=new winston[(_0xc4c0('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xc4c0('0x20'))]({'name':util[_0xc4c0('0x10')](_0xc4c0('0x21'),_0x56f3dd,'error'),'filename':getLogFileName(_0x3e9a7a,_0x56f3dd,'error'),'level':_0xc4c0('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3eab88){return fileFormat(_0x56f3dd,_0x3eab88);}}),new winston[(_0xc4c0('0x1c'))]['File']({'name':util['format'](_0xc4c0('0x21'),_0x56f3dd,debugLevel),'filename':getLogFileName(_0x3e9a7a,_0x56f3dd,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3f925a){return fileFormat(_0x56f3dd,_0x3f925a);}}),new winston['transports'][(_0xc4c0('0x1d'))]({'level':_0xc4c0('0x1e'),'json':![],'formatter':function(_0x26cdec){return fileFormat(_0x56f3dd,_0x26cdec);}})]});return _0x4b76fd;}exports[_0xc4c0('0x23')]=consoleLogger;exports[_0xc4c0('0x24')]=fileLogger;
\ No newline at end of file
+var _0xdbbd=['%s-%s','consoleLogger','fileLogger','path','util','moment','winston','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','gray','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Console','warn','transports','File','error'];(function(_0x3e8de2,_0x468431){var _0x56b736=function(_0x32da9b){while(--_0x32da9b){_0x3e8de2['push'](_0x3e8de2['shift']());}};_0x56b736(++_0x468431);}(_0xdbbd,0x1e4));var _0xddbb=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xdbbd[_0x288f5e];return _0x476cc9;};'use strict';var path=require(_0xddbb('0x0'));var util=require(_0xddbb('0x1'));var moment=require(_0xddbb('0x2'));var winston=require(_0xddbb('0x3'));var config=require('../config/environment');var debugLevel=config[_0xddbb('0x4')]?config[_0xddbb('0x4')][_0xddbb('0x5')]():_0xddbb('0x6');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':_0xddbb('0x7'),'error':_0xddbb('0x8'),'warn':_0xddbb('0x9'),'info':_0xddbb('0xa'),'print':'bold\x20white','success':'bold\x20green','http':_0xddbb('0xb'),'verbose':'bold\x20magenta','debug':_0xddbb('0xc'),'silly':_0xddbb('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x4205cf,_0x111b32,_0x4e7e4e){var _0x79e59b=_0x4205cf||_0xddbb('0xe');return path[_0xddbb('0xf')](_0x79e59b,util[_0xddbb('0x10')](_0xddbb('0x11'),_0x111b32,_0x4e7e4e));}function formatter(_0x7ac0c5,_0x4b7df1){_0x4b7df1['message']=_0x4b7df1[_0xddbb('0x12')][_0xddbb('0x13')](/@@{/g,_0xddbb('0x14'))[_0xddbb('0x13')](/}@@/g,_0xddbb('0x15'))[_0xddbb('0x13')](/@{/g,'{{')[_0xddbb('0x13')](/}@/g,'}}');return util[_0xddbb('0x10')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xddbb('0x10')](_0xddbb('0x16')),_0x4b7df1['level']['toUpperCase'](),_0x7ac0c5,_0x4b7df1[_0xddbb('0x12')]);}function fileFormat(_0x350b49,_0x4b9828){_0x4b9828['message']=_0x4b9828[_0xddbb('0x12')]['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0xddbb('0x15'))[_0xddbb('0x13')](/@{/g,'{{')[_0xddbb('0x13')](/}@/g,'}}');var _0x52f138=_0x4b9828[_0xddbb('0x17')]&&Object[_0xddbb('0x18')](_0x4b9828[_0xddbb('0x17')])[_0xddbb('0x19')]?'\x0a\x09'+JSON[_0xddbb('0x1a')](_0x4b9828[_0xddbb('0x17')]):'';return util[_0xddbb('0x10')](_0xddbb('0x1b'),moment()['format'](_0xddbb('0x16')),_0x4b9828[_0xddbb('0x1c')]['toUpperCase'](),_0x350b49,_0x4b9828['message'],_0x52f138);}function consoleLogger(){var _0x20ddde=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xddbb('0x1d'))]({'level':_0xddbb('0x1e'),'json':![],'formatter':function(_0x5b14a0){return formatter('',_0x5b14a0);}})]});return _0x20ddde;}function fileLogger(_0x33d705,_0xf75151){var _0x5839b4=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xddbb('0x1f'))][(_0xddbb('0x20'))]({'name':util['format']('%s-%s',_0x33d705,'error'),'filename':getLogFileName(_0xf75151,_0x33d705,_0xddbb('0x21')),'level':_0xddbb('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1efece){return fileFormat(_0x33d705,_0x1efece);}}),new winston[(_0xddbb('0x1f'))][(_0xddbb('0x20'))]({'name':util['format'](_0xddbb('0x22'),_0x33d705,debugLevel),'filename':getLogFileName(_0xf75151,_0x33d705,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x30fd26){return fileFormat(_0x33d705,_0x30fd26);}}),new winston[(_0xddbb('0x1f'))][(_0xddbb('0x1d'))]({'level':'warn','json':![],'formatter':function(_0x5e35fb){return fileFormat(_0x33d705,_0x5e35fb);}})]});return _0x5839b4;}exports[_0xddbb('0x23')]=consoleLogger;exports[_0xddbb('0x24')]=fileLogger;
\ No newline at end of file