Built motion from commit 936e8062.|2.5.33
[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 _0x8c85=['%s-%s','error','transports','info','Console','debugLevel','winston','util','path','INFO','join','/var','log','xcally','format','%s-%s.log','message','replace','{{{','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','Logger','File'];(function(_0x581757,_0x58fd02){var _0x34dc01=function(_0x6800c5){while(--_0x6800c5){_0x581757['push'](_0x581757['shift']());}};_0x34dc01(++_0x58fd02);}(_0x8c85,0xd5));var _0x58c8=function(_0x2f7870,_0x5f35cf){_0x2f7870=_0x2f7870-0x0;var _0x46936e=_0x8c85[_0x2f7870];return _0x46936e;};'use strict';var moment=require('moment');var winston=require(_0x58c8('0x0'));var util=require(_0x58c8('0x1'));var path=require(_0x58c8('0x2'));var debugLevel=_0x58c8('0x3');function filename(_0x92633a,_0x1aa3f1){return path[_0x58c8('0x4')](_0x58c8('0x5'),_0x58c8('0x6'),_0x58c8('0x7'),util[_0x58c8('0x8')](_0x58c8('0x9'),_0x92633a,_0x1aa3f1));}function formatter(_0x5ed045,_0x3e2344){_0x3e2344['message']=_0x3e2344[_0x58c8('0xa')][_0x58c8('0xb')](/@@{/g,_0x58c8('0xc'))[_0x58c8('0xb')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x58c8('0xb')](/}@/g,'}}');return util[_0x58c8('0x8')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x58c8('0x8')](_0x58c8('0xd')),_0x3e2344['level'][_0x58c8('0xe')](),_0x5ed045,_0x3e2344[_0x58c8('0xa')]);}module['exports']=function(_0x3e643e){return new winston[(_0x58c8('0xf'))]({'transports':[new winston['transports'][(_0x58c8('0x10'))]({'name':util['format'](_0x58c8('0x11'),_0x3e643e,_0x58c8('0x12')),'filename':filename(_0x3e643e,_0x58c8('0x12')),'level':_0x58c8('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x50d279){return formatter(_0x3e643e,_0x50d279);}}),new winston[(_0x58c8('0x13'))][(_0x58c8('0x10'))]({'name':util[_0x58c8('0x8')]('%s-%s',_0x3e643e,_0x58c8('0x14')),'filename':filename(_0x3e643e,_0x58c8('0x14')),'level':_0x58c8('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1c1c41){return formatter(_0x3e643e,_0x1c1c41);}}),new winston[(_0x58c8('0x13'))][(_0x58c8('0x15'))]({'level':process['env'][_0x58c8('0x16')]||debugLevel,'json':![],'formatter':function(_0x1dbeaf){return formatter(_0x3e643e,_0x1dbeaf);}})]});};