Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / utils / loggers.js
index 8edcaae..cf5bbfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61fb=['replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','length','stringify','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','util','moment','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','bold\x20green','gray','bold\x20magenta','bold\x20cyan','addColors','format','%s-%s.log','message'];(function(_0x4bb30f,_0x2f9149){var _0x2685c1=function(_0x25550a){while(--_0x25550a){_0x4bb30f['push'](_0x4bb30f['shift']());}};_0x2685c1(++_0x2f9149);}(_0x61fb,0x1ef));var _0xb61f=function(_0x36643f,_0x5e3acb){_0x36643f=_0x36643f-0x0;var _0x1ab487=_0x61fb[_0x36643f];return _0x1ab487;};'use strict';var path=require('path');var util=require(_0xb61f('0x0'));var moment=require(_0xb61f('0x1'));var winston=require('winston');var config=require(_0xb61f('0x2'));var debugLevel=config[_0xb61f('0x3')]?config['debugLevel'][_0xb61f('0x4')]():'info';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':_0xb61f('0x5'),'error':_0xb61f('0x6'),'warn':'bold\x20yellow','info':'white','print':'bold\x20white','success':_0xb61f('0x7'),'http':_0xb61f('0x8'),'verbose':_0xb61f('0x9'),'debug':'bold\x20blue','silly':_0xb61f('0xa')};winston[_0xb61f('0xb')](XC_LOG_COLORS);function getLogFileName(_0x5930e3,_0x22c670,_0x2fd383){var _0x5e23dd=_0x5930e3||'/var/log/xcally';return path['join'](_0x5e23dd,util[_0xb61f('0xc')](_0xb61f('0xd'),_0x22c670,_0x2fd383));}function formatter(_0x33d381,_0x386765){_0x386765[_0xb61f('0xe')]=_0x386765['message'][_0xb61f('0xf')](/@@{/g,_0xb61f('0x10'))['replace'](/}@@/g,_0xb61f('0x11'))['replace'](/@{/g,'{{')[_0xb61f('0xf')](/}@/g,'}}');return util[_0xb61f('0xc')](_0xb61f('0x12'),moment()['format'](_0xb61f('0x13')),_0x386765[_0xb61f('0x14')][_0xb61f('0x15')](),_0x33d381,_0x386765[_0xb61f('0xe')]);}function fileFormat(_0x17fd0d,_0x77bc58){_0x77bc58[_0xb61f('0xe')]=_0x77bc58[_0xb61f('0xe')]['replace'](/@@{/g,'{{{')['replace'](/}@@/g,'}}}')[_0xb61f('0xf')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x5d1eee=_0x77bc58[_0xb61f('0x16')]&&Object['keys'](_0x77bc58[_0xb61f('0x16')])[_0xb61f('0x17')]?'\x0a\x09'+JSON[_0xb61f('0x18')](_0x77bc58['meta']):'';return util[_0xb61f('0xc')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xb61f('0xc')](_0xb61f('0x13')),_0x77bc58[_0xb61f('0x14')][_0xb61f('0x15')](),_0x17fd0d,_0x77bc58[_0xb61f('0xe')],_0x5d1eee);}function consoleLogger(){var _0x464bc9=new winston[(_0xb61f('0x19'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb61f('0x1a'))][(_0xb61f('0x1b'))]({'level':_0xb61f('0x1c'),'json':![],'formatter':function(_0x3c6af9){return formatter('',_0x3c6af9);}})]});return _0x464bc9;}function fileLogger(_0x2447c1,_0x4b1ccb){var _0x4a84a7=new winston[(_0xb61f('0x19'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xb61f('0x1d'))]({'name':util[_0xb61f('0xc')](_0xb61f('0x1e'),_0x2447c1,_0xb61f('0x1f')),'filename':getLogFileName(_0x4b1ccb,_0x2447c1,_0xb61f('0x1f')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2910ae){return fileFormat(_0x2447c1,_0x2910ae);}}),new winston['transports'][(_0xb61f('0x1d'))]({'name':util['format'](_0xb61f('0x1e'),_0x2447c1,debugLevel),'filename':getLogFileName(_0x4b1ccb,_0x2447c1,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x738903){return fileFormat(_0x2447c1,_0x738903);}}),new winston[(_0xb61f('0x1a'))][(_0xb61f('0x1b'))]({'level':_0xb61f('0x1c'),'json':![],'formatter':function(_0x14feee){return fileFormat(_0x2447c1,_0x14feee);}})]});return _0x4a84a7;}exports[_0xb61f('0x20')]=consoleLogger;exports[_0xb61f('0x21')]=fileLogger;
\ No newline at end of file
+var _0x90f0=['info','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','join','format','%s-%s.log','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','message','}}}','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','transports','Console','warn','Logger','File','error','%s-%s','consoleLogger','fileLogger','path','util','moment','winston','debugLevel','toLowerCase'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x90f0,0x180));var _0x090f=function(_0x48cc96,_0x242d75){_0x48cc96=_0x48cc96-0x0;var _0x5cd2d0=_0x90f0[_0x48cc96];return _0x5cd2d0;};'use strict';var path=require(_0x090f('0x0'));var util=require(_0x090f('0x1'));var moment=require(_0x090f('0x2'));var winston=require(_0x090f('0x3'));var config=require('../config/environment');var debugLevel=config[_0x090f('0x4')]?config[_0x090f('0x4')][_0x090f('0x5')]():_0x090f('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':_0x090f('0x7'),'error':_0x090f('0x8'),'warn':_0x090f('0x9'),'info':'white','print':_0x090f('0xa'),'success':_0x090f('0xb'),'http':'gray','verbose':_0x090f('0xc'),'debug':_0x090f('0xd'),'silly':_0x090f('0xe')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x2c7ae5,_0x21a3e5,_0x58990b){var _0x1a46e3=_0x2c7ae5||'/var/log/xcally';return path[_0x090f('0xf')](_0x1a46e3,util[_0x090f('0x10')](_0x090f('0x11'),_0x21a3e5,_0x58990b));}function formatter(_0x1b2e09,_0x39d454){_0x39d454['message']=_0x39d454['message'][_0x090f('0x12')](/@@{/g,_0x090f('0x13'))['replace'](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x090f('0x12')](/}@/g,'}}');return util[_0x090f('0x10')](_0x090f('0x14'),moment()[_0x090f('0x10')](_0x090f('0x15')),_0x39d454['level']['toUpperCase'](),_0x1b2e09,_0x39d454[_0x090f('0x16')]);}function fileFormat(_0x5922e7,_0x4fbde1){_0x4fbde1[_0x090f('0x16')]=_0x4fbde1[_0x090f('0x16')]['replace'](/@@{/g,_0x090f('0x13'))[_0x090f('0x12')](/}@@/g,_0x090f('0x17'))[_0x090f('0x12')](/@{/g,'{{')[_0x090f('0x12')](/}@/g,'}}');var _0x2601c1=_0x4fbde1[_0x090f('0x18')]&&Object[_0x090f('0x19')](_0x4fbde1[_0x090f('0x18')])[_0x090f('0x1a')]?'\x0a\x09'+JSON[_0x090f('0x1b')](_0x4fbde1[_0x090f('0x18')]):'';return util[_0x090f('0x10')](_0x090f('0x1c'),moment()[_0x090f('0x10')](_0x090f('0x15')),_0x4fbde1[_0x090f('0x1d')]['toUpperCase'](),_0x5922e7,_0x4fbde1[_0x090f('0x16')],_0x2601c1);}function consoleLogger(){var _0x1c20d4=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x090f('0x1e'))][(_0x090f('0x1f'))]({'level':_0x090f('0x20'),'json':![],'formatter':function(_0x333781){return formatter('',_0x333781);}})]});return _0x1c20d4;}function fileLogger(_0x14f41d,_0x1355f6){var _0x2b2071=new winston[(_0x090f('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x090f('0x22'))]({'name':util[_0x090f('0x10')]('%s-%s',_0x14f41d,_0x090f('0x23')),'filename':getLogFileName(_0x1355f6,_0x14f41d,_0x090f('0x23')),'level':_0x090f('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x344391){return fileFormat(_0x14f41d,_0x344391);}}),new winston[(_0x090f('0x1e'))][(_0x090f('0x22'))]({'name':util[_0x090f('0x10')](_0x090f('0x24'),_0x14f41d,debugLevel),'filename':getLogFileName(_0x1355f6,_0x14f41d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5659f8){return fileFormat(_0x14f41d,_0x5659f8);}}),new winston[(_0x090f('0x1e'))][(_0x090f('0x1f'))]({'level':'warn','json':![],'formatter':function(_0x132451){return fileFormat(_0x14f41d,_0x132451);}})]});return _0x2b2071;}exports[_0x090f('0x25')]=consoleLogger;exports[_0x090f('0x26')]=fileLogger;
\ No newline at end of file