Built motion from commit (unavailable).|2.5.21
[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 _0x1eb3=['path','INFO','join','xcally','%s-%s.log','message','replace','}}}','format','YYYY-MM-DD\x20HH:mm:ss','level','transports','%s-%s','error','File','info','Console','moment','winston','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1eb3,0x9d));var _0x31eb=function(_0x3e2478,_0x2968f7){_0x3e2478=_0x3e2478-0x0;var _0x5466e0=_0x1eb3[_0x3e2478];return _0x5466e0;};'use strict';var moment=require(_0x31eb('0x0'));var winston=require(_0x31eb('0x1'));var util=require(_0x31eb('0x2'));var path=require(_0x31eb('0x3'));var debugLevel=_0x31eb('0x4');function filename(_0x36edc4,_0xd6fdc0){return path[_0x31eb('0x5')]('/var','log',_0x31eb('0x6'),util['format'](_0x31eb('0x7'),_0x36edc4,_0xd6fdc0));}function formatter(_0x5ed36f,_0xf7f3d3){_0xf7f3d3[_0x31eb('0x8')]=_0xf7f3d3[_0x31eb('0x8')][_0x31eb('0x9')](/@@{/g,'{{{')[_0x31eb('0x9')](/}@@/g,_0x31eb('0xa'))[_0x31eb('0x9')](/@{/g,'{{')[_0x31eb('0x9')](/}@/g,'}}');return util[_0x31eb('0xb')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x31eb('0xb')](_0x31eb('0xc')),_0xf7f3d3[_0x31eb('0xd')]['toUpperCase'](),_0x5ed36f,_0xf7f3d3['message']);}module['exports']=function(_0x197eb2){return new winston['Logger']({'transports':[new winston[(_0x31eb('0xe'))]['File']({'name':util['format'](_0x31eb('0xf'),_0x197eb2,_0x31eb('0x10')),'filename':filename(_0x197eb2,_0x31eb('0x10')),'level':_0x31eb('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x17e558){return formatter(_0x197eb2,_0x17e558);}}),new winston[(_0x31eb('0xe'))][(_0x31eb('0x11'))]({'name':util[_0x31eb('0xb')](_0x31eb('0xf'),_0x197eb2,_0x31eb('0x12')),'filename':filename(_0x197eb2,_0x31eb('0x12')),'level':_0x31eb('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x178ded){return formatter(_0x197eb2,_0x178ded);}}),new winston['transports'][(_0x31eb('0x13'))]({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x2332b7){return formatter(_0x197eb2,_0x2332b7);}})]});};