Built motion from commit 15aa0e42.|2.6.19
[motion2.git] / server / utils / loggers.js
index 50cae51..1e9f465 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d30=['warn','File','%s-%s','error','consoleLogger','fileLogger','path','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20blue','bold\x20cyan','/var/log/xcally','join','%s-%s.log','message','replace','{{{','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','}}}','meta','keys','length','toUpperCase','Logger','transports','Console'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x3d30,0x75));var _0x03d3=function(_0x45496c,_0xb76fb1){_0x45496c=_0x45496c-0x0;var _0x17945a=_0x3d30[_0x45496c];return _0x17945a;};'use strict';var path=require(_0x03d3('0x0'));var util=require('util');var moment=require('moment');var winston=require('winston');var config=require(_0x03d3('0x1'));var debugLevel=config[_0x03d3('0x2')]?config['debugLevel'][_0x03d3('0x3')]():_0x03d3('0x4');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':_0x03d3('0x5'),'error':_0x03d3('0x6'),'warn':_0x03d3('0x7'),'info':'white','print':_0x03d3('0x8'),'success':_0x03d3('0x9'),'http':_0x03d3('0xa'),'verbose':'bold\x20magenta','debug':_0x03d3('0xb'),'silly':_0x03d3('0xc')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x367d3b,_0x33ef59,_0x19df6f){var _0x27e3f0=_0x367d3b||_0x03d3('0xd');return path[_0x03d3('0xe')](_0x27e3f0,util['format'](_0x03d3('0xf'),_0x33ef59,_0x19df6f));}function formatter(_0x3e3ad8,_0xde4969){_0xde4969[_0x03d3('0x10')]=_0xde4969[_0x03d3('0x10')][_0x03d3('0x11')](/@@{/g,_0x03d3('0x12'))['replace'](/}@@/g,'}}}')[_0x03d3('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x03d3('0x13')](_0x03d3('0x14'),moment()[_0x03d3('0x13')](_0x03d3('0x15')),_0xde4969[_0x03d3('0x16')]['toUpperCase'](),_0x3e3ad8,_0xde4969[_0x03d3('0x10')]);}function fileFormat(_0x1a06e8,_0x886469){_0x886469[_0x03d3('0x10')]=_0x886469['message'][_0x03d3('0x11')](/@@{/g,'{{{')[_0x03d3('0x11')](/}@@/g,_0x03d3('0x17'))[_0x03d3('0x11')](/@{/g,'{{')[_0x03d3('0x11')](/}@/g,'}}');var _0x5125cb=_0x886469[_0x03d3('0x18')]&&Object[_0x03d3('0x19')](_0x886469[_0x03d3('0x18')])[_0x03d3('0x1a')]?'\x0a\x09'+JSON['stringify'](_0x886469[_0x03d3('0x18')]):'';return util[_0x03d3('0x13')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x03d3('0x13')](_0x03d3('0x15')),_0x886469[_0x03d3('0x16')][_0x03d3('0x1b')](),_0x1a06e8,_0x886469[_0x03d3('0x10')],_0x5125cb);}function consoleLogger(){var _0x304663=new winston[(_0x03d3('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x03d3('0x1d'))][(_0x03d3('0x1e'))]({'level':_0x03d3('0x1f'),'json':![],'formatter':function(_0x5e21c2){return formatter('',_0x5e21c2);}})]});return _0x304663;}function fileLogger(_0x1ada68,_0xd0e79f){var _0x4421e0=new winston[(_0x03d3('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x03d3('0x1d'))][(_0x03d3('0x20'))]({'name':util[_0x03d3('0x13')](_0x03d3('0x21'),_0x1ada68,_0x03d3('0x22')),'filename':getLogFileName(_0xd0e79f,_0x1ada68,'error'),'level':_0x03d3('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2a5d20){return fileFormat(_0x1ada68,_0x2a5d20);}}),new winston[(_0x03d3('0x1d'))][(_0x03d3('0x20'))]({'name':util[_0x03d3('0x13')]('%s-%s',_0x1ada68,debugLevel),'filename':getLogFileName(_0xd0e79f,_0x1ada68,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x58bba1){return fileFormat(_0x1ada68,_0x58bba1);}}),new winston['transports']['Console']({'level':_0x03d3('0x1f'),'json':![],'formatter':function(_0x3c5bfd){return fileFormat(_0x1ada68,_0x3c5bfd);}})]});return _0x4421e0;}exports[_0x03d3('0x23')]=consoleLogger;exports[_0x03d3('0x24')]=fileLogger;
\ No newline at end of file
+var _0x31f2=['stringify','Logger','transports','Console','File','error','%s-%s','warn','consoleLogger','path','util','moment','winston','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20cyan','/var/log/xcally','format','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','keys','meta','length'];(function(_0x1b270a,_0x5ede7f){var _0x5bf3b2=function(_0x384f32){while(--_0x384f32){_0x1b270a['push'](_0x1b270a['shift']());}};_0x5bf3b2(++_0x5ede7f);}(_0x31f2,0xe1));var _0x231f=function(_0x27612c,_0x4707b4){_0x27612c=_0x27612c-0x0;var _0x53b6e5=_0x31f2[_0x27612c];return _0x53b6e5;};'use strict';var path=require(_0x231f('0x0'));var util=require(_0x231f('0x1'));var moment=require(_0x231f('0x2'));var winston=require(_0x231f('0x3'));var config=require('../config/environment');var debugLevel=config[_0x231f('0x4')]?config[_0x231f('0x4')][_0x231f('0x5')]():_0x231f('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':_0x231f('0x7'),'error':_0x231f('0x8'),'warn':_0x231f('0x9'),'info':_0x231f('0xa'),'print':_0x231f('0xb'),'success':_0x231f('0xc'),'http':'gray','verbose':'bold\x20magenta','debug':'bold\x20blue','silly':_0x231f('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x22f239,_0xcb1be,_0x4846c3){var _0x388fb0=_0x22f239||_0x231f('0xe');return path['join'](_0x388fb0,util[_0x231f('0xf')]('%s-%s.log',_0xcb1be,_0x4846c3));}function formatter(_0x1a7412,_0x329152){_0x329152['message']=_0x329152['message'][_0x231f('0x10')](/@@{/g,_0x231f('0x11'))[_0x231f('0x10')](/}@@/g,_0x231f('0x12'))['replace'](/@{/g,'{{')[_0x231f('0x10')](/}@/g,'}}');return util[_0x231f('0xf')](_0x231f('0x13'),moment()[_0x231f('0xf')](_0x231f('0x14')),_0x329152[_0x231f('0x15')][_0x231f('0x16')](),_0x1a7412,_0x329152[_0x231f('0x17')]);}function fileFormat(_0x4eee42,_0x5cbb0b){_0x5cbb0b[_0x231f('0x17')]=_0x5cbb0b[_0x231f('0x17')][_0x231f('0x10')](/@@{/g,_0x231f('0x11'))['replace'](/}@@/g,_0x231f('0x12'))[_0x231f('0x10')](/@{/g,'{{')[_0x231f('0x10')](/}@/g,'}}');var _0x4f485f=_0x5cbb0b['meta']&&Object[_0x231f('0x18')](_0x5cbb0b[_0x231f('0x19')])[_0x231f('0x1a')]?'\x0a\x09'+JSON[_0x231f('0x1b')](_0x5cbb0b[_0x231f('0x19')]):'';return util[_0x231f('0xf')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x231f('0xf')](_0x231f('0x14')),_0x5cbb0b[_0x231f('0x15')][_0x231f('0x16')](),_0x4eee42,_0x5cbb0b[_0x231f('0x17')],_0x4f485f);}function consoleLogger(){var _0x1b1e4c=new winston[(_0x231f('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x231f('0x1d'))][(_0x231f('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x340bab){return formatter('',_0x340bab);}})]});return _0x1b1e4c;}function fileLogger(_0x2ee925,_0x2825e2){var _0x21e6dc=new winston[(_0x231f('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x231f('0x1f'))]({'name':util[_0x231f('0xf')]('%s-%s',_0x2ee925,'error'),'filename':getLogFileName(_0x2825e2,_0x2ee925,_0x231f('0x20')),'level':_0x231f('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2c3e25){return fileFormat(_0x2ee925,_0x2c3e25);}}),new winston[(_0x231f('0x1d'))]['File']({'name':util[_0x231f('0xf')](_0x231f('0x21'),_0x2ee925,debugLevel),'filename':getLogFileName(_0x2825e2,_0x2ee925,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x7ea040){return fileFormat(_0x2ee925,_0x7ea040);}}),new winston['transports'][(_0x231f('0x1e'))]({'level':_0x231f('0x22'),'json':![],'formatter':function(_0x574d01){return fileFormat(_0x2ee925,_0x574d01);}})]});return _0x21e6dc;}exports[_0x231f('0x23')]=consoleLogger;exports['fileLogger']=fileLogger;
\ No newline at end of file