Built motion from commit 19a84241.|2.5.34
[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 _0x6f26=['util','path','join','/var','log','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','env'];(function(_0x36b8a2,_0x1d742f){var _0x1c98c5=function(_0x35ccf4){while(--_0x35ccf4){_0x36b8a2['push'](_0x36b8a2['shift']());}};_0x1c98c5(++_0x1d742f);}(_0x6f26,0x12b));var _0x66f2=function(_0x6cd197,_0x33df63){_0x6cd197=_0x6cd197-0x0;var _0x3480c7=_0x6f26[_0x6cd197];return _0x3480c7;};'use strict';var moment=require('moment');var winston=require('winston');var util=require(_0x66f2('0x0'));var path=require(_0x66f2('0x1'));var debugLevel='INFO';function filename(_0x16aae9,_0x34567e){return path[_0x66f2('0x2')](_0x66f2('0x3'),_0x66f2('0x4'),'xcally',util['format'](_0x66f2('0x5'),_0x16aae9,_0x34567e));}function formatter(_0x15ac8c,_0x2f937e){_0x2f937e[_0x66f2('0x6')]=_0x2f937e['message'][_0x66f2('0x7')](/@@{/g,_0x66f2('0x8'))[_0x66f2('0x7')](/}@@/g,_0x66f2('0x9'))[_0x66f2('0x7')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x66f2('0xa')](_0x66f2('0xb'),moment()['format'](_0x66f2('0xc')),_0x2f937e[_0x66f2('0xd')][_0x66f2('0xe')](),_0x15ac8c,_0x2f937e[_0x66f2('0x6')]);}module[_0x66f2('0xf')]=function(_0x50eeb5){return new winston[(_0x66f2('0x10'))]({'transports':[new winston[(_0x66f2('0x11'))][(_0x66f2('0x12'))]({'name':util[_0x66f2('0xa')](_0x66f2('0x13'),_0x50eeb5,_0x66f2('0x14')),'filename':filename(_0x50eeb5,_0x66f2('0x14')),'level':_0x66f2('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5784e0){return formatter(_0x50eeb5,_0x5784e0);}}),new winston['transports'][(_0x66f2('0x12'))]({'name':util[_0x66f2('0xa')](_0x66f2('0x13'),_0x50eeb5,_0x66f2('0x15')),'filename':filename(_0x50eeb5,_0x66f2('0x15')),'level':_0x66f2('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x8be152){return formatter(_0x50eeb5,_0x8be152);}}),new winston[(_0x66f2('0x11'))]['Console']({'level':process[_0x66f2('0x16')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x68afb){return formatter(_0x50eeb5,_0x68afb);}})]});};