056c77922c579a92864c429c83044b12f13f14e1
[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 _0x054f=['toUpperCase','exports','Logger','transports','File','%s-%s','error','info','env','debugLevel','moment','winston','util','join','/var','log','format','%s-%s.log','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s'];(function(_0xb4cc12,_0x41436e){var _0x8593b5=function(_0x13b840){while(--_0x13b840){_0xb4cc12['push'](_0xb4cc12['shift']());}};_0x8593b5(++_0x41436e);}(_0x054f,0x130));var _0xf054=function(_0x1878c3,_0xeb9458){_0x1878c3=_0x1878c3-0x0;var _0x1e3431=_0x054f[_0x1878c3];return _0x1e3431;};'use strict';var moment=require(_0xf054('0x0'));var winston=require(_0xf054('0x1'));var util=require(_0xf054('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x456a46,_0x508136){return path[_0xf054('0x3')](_0xf054('0x4'),_0xf054('0x5'),'xcally',util[_0xf054('0x6')](_0xf054('0x7'),_0x456a46,_0x508136));}function formatter(_0x48a1b6,_0x142265){_0x142265['message']=_0x142265[_0xf054('0x8')][_0xf054('0x9')](/@@{/g,'{{{')[_0xf054('0x9')](/}@@/g,'}}}')[_0xf054('0x9')](/@{/g,'{{')[_0xf054('0x9')](/}@/g,'}}');return util[_0xf054('0x6')](_0xf054('0xa'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x142265['level'][_0xf054('0xb')](),_0x48a1b6,_0x142265['message']);}module[_0xf054('0xc')]=function(_0x35d1d1){return new winston[(_0xf054('0xd'))]({'transports':[new winston[(_0xf054('0xe'))][(_0xf054('0xf'))]({'name':util[_0xf054('0x6')](_0xf054('0x10'),_0x35d1d1,_0xf054('0x11')),'filename':filename(_0x35d1d1,'error'),'level':_0xf054('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x582d9b){return formatter(_0x35d1d1,_0x582d9b);}}),new winston['transports'][(_0xf054('0xf'))]({'name':util['format'](_0xf054('0x10'),_0x35d1d1,_0xf054('0x12')),'filename':filename(_0x35d1d1,_0xf054('0x12')),'level':_0xf054('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x485e63){return formatter(_0x35d1d1,_0x485e63);}}),new winston[(_0xf054('0xe'))]['Console']({'level':process[_0xf054('0x13')][_0xf054('0x14')]||debugLevel,'json':![],'formatter':function(_0x5849eb){return formatter(_0x35d1d1,_0x5849eb);}})]});};