Built motion from commit (unavailable).|2.4.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 _0x5a64=['util','join','/var','log','xcally','format','%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston'];(function(_0x39cad6,_0x1edf41){var _0x5a82f2=function(_0x416563){while(--_0x416563){_0x39cad6['push'](_0x39cad6['shift']());}};_0x5a82f2(++_0x1edf41);}(_0x5a64,0x132));var _0x45a6=function(_0x1b2f73,_0x2e5d29){_0x1b2f73=_0x1b2f73-0x0;var _0x459eae=_0x5a64[_0x1b2f73];return _0x459eae;};'use strict';var moment=require(_0x45a6('0x0'));var winston=require(_0x45a6('0x1'));var util=require(_0x45a6('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x546571,_0x45e343){return path[_0x45a6('0x3')](_0x45a6('0x4'),_0x45a6('0x5'),_0x45a6('0x6'),util[_0x45a6('0x7')](_0x45a6('0x8'),_0x546571,_0x45e343));}function formatter(_0x38d1bf,_0x2de637){return util[_0x45a6('0x7')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format'](_0x45a6('0x9')),_0x2de637['level'][_0x45a6('0xa')](),_0x38d1bf,_0x2de637[_0x45a6('0xb')]);}module[_0x45a6('0xc')]=function(_0x5e0d38){return new winston[(_0x45a6('0xd'))]({'transports':[new winston[(_0x45a6('0xe'))][(_0x45a6('0xf'))]({'name':util['format'](_0x45a6('0x10'),_0x5e0d38,_0x45a6('0x11')),'filename':filename(_0x5e0d38,_0x45a6('0x11')),'level':_0x45a6('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x654877){return formatter(_0x5e0d38,_0x654877);}}),new winston['transports'][(_0x45a6('0xf'))]({'name':util[_0x45a6('0x7')](_0x45a6('0x10'),_0x5e0d38,_0x45a6('0x12')),'filename':filename(_0x5e0d38,_0x45a6('0x12')),'level':_0x45a6('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2ebd0a){return formatter(_0x5e0d38,_0x2ebd0a);}}),new winston['transports'][(_0x45a6('0x13'))]({'level':process[_0x45a6('0x14')][_0x45a6('0x15')]||debugLevel,'json':![],'formatter':function(_0x31ca37){return formatter(_0x5e0d38,_0x31ca37);}})]});};