Built motion from commit (unavailable).|2.5.25
[motion2.git] / server / config / logger.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x13d9=['format','%s-%s.log','message','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','Logger','transports','%s-%s','error','info','env','debugLevel','moment','winston','util','path','join','xcally'];(function(_0x180591,_0x410a4a){var _0x22c468=function(_0x2ddb7e){while(--_0x2ddb7e){_0x180591['push'](_0x180591['shift']());}};_0x22c468(++_0x410a4a);}(_0x13d9,0x1f2));var _0x913d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x13d9[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x913d('0x0'));var winston=require(_0x913d('0x1'));var util=require(_0x913d('0x2'));var path=require(_0x913d('0x3'));var debugLevel='INFO';function filename(_0x3b0716,_0x1b962c){return path[_0x913d('0x4')]('/var','log',_0x913d('0x5'),util[_0x913d('0x6')](_0x913d('0x7'),_0x3b0716,_0x1b962c));}function formatter(_0x3631dd,_0x4765de){_0x4765de['message']=_0x4765de[_0x913d('0x8')][_0x913d('0x9')](/@@{/g,'{{{')['replace'](/}@@/g,_0x913d('0xa'))[_0x913d('0x9')](/@{/g,'{{')[_0x913d('0x9')](/}@/g,'}}');return util[_0x913d('0x6')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x913d('0x6')](_0x913d('0xb')),_0x4765de[_0x913d('0xc')][_0x913d('0xd')](),_0x3631dd,_0x4765de[_0x913d('0x8')]);}module['exports']=function(_0x5dc1ea){return new winston[(_0x913d('0xe'))]({'transports':[new winston[(_0x913d('0xf'))]['File']({'name':util[_0x913d('0x6')](_0x913d('0x10'),_0x5dc1ea,_0x913d('0x11')),'filename':filename(_0x5dc1ea,_0x913d('0x11')),'level':_0x913d('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xcc1fe3){return formatter(_0x5dc1ea,_0xcc1fe3);}}),new winston[(_0x913d('0xf'))]['File']({'name':util[_0x913d('0x6')](_0x913d('0x10'),_0x5dc1ea,'info'),'filename':filename(_0x5dc1ea,'info'),'level':_0x913d('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3243f0){return formatter(_0x5dc1ea,_0x3243f0);}}),new winston['transports']['Console']({'level':process[_0x913d('0x13')][_0x913d('0x14')]||debugLevel,'json':![],'formatter':function(_0x33c5c4){return formatter(_0x5dc1ea,_0x33c5c4);}})]});};