e6399f6d0357b2910528c41117c6038132ee3aff
[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 _0xb995=['Console','env','debugLevel','moment','winston','util','path','INFO','join','/var','format','%s-%s.log','message','{{{','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','exports','Logger','transports','%s-%s','error','File','info'];(function(_0x16376a,_0x19d54c){var _0x112d91=function(_0x211f1e){while(--_0x211f1e){_0x16376a['push'](_0x16376a['shift']());}};_0x112d91(++_0x19d54c);}(_0xb995,0x67));var _0x5b99=function(_0x499283,_0x5635cb){_0x499283=_0x499283-0x0;var _0x12545e=_0xb995[_0x499283];return _0x12545e;};'use strict';var moment=require(_0x5b99('0x0'));var winston=require(_0x5b99('0x1'));var util=require(_0x5b99('0x2'));var path=require(_0x5b99('0x3'));var debugLevel=_0x5b99('0x4');function filename(_0xd3cc08,_0x1af03a){return path[_0x5b99('0x5')](_0x5b99('0x6'),'log','xcally',util[_0x5b99('0x7')](_0x5b99('0x8'),_0xd3cc08,_0x1af03a));}function formatter(_0x5106d2,_0x8625f6){_0x8625f6[_0x5b99('0x9')]=_0x8625f6['message']['replace'](/@@{/g,_0x5b99('0xa'))['replace'](/}@@/g,_0x5b99('0xb'))[_0x5b99('0xc')](/@{/g,'{{')[_0x5b99('0xc')](/}@/g,'}}');return util[_0x5b99('0x7')](_0x5b99('0xd'),moment()[_0x5b99('0x7')](_0x5b99('0xe')),_0x8625f6['level']['toUpperCase'](),_0x5106d2,_0x8625f6[_0x5b99('0x9')]);}module[_0x5b99('0xf')]=function(_0x414916){return new winston[(_0x5b99('0x10'))]({'transports':[new winston[(_0x5b99('0x11'))]['File']({'name':util['format'](_0x5b99('0x12'),_0x414916,_0x5b99('0x13')),'filename':filename(_0x414916,_0x5b99('0x13')),'level':_0x5b99('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4817c6){return formatter(_0x414916,_0x4817c6);}}),new winston[(_0x5b99('0x11'))][(_0x5b99('0x14'))]({'name':util[_0x5b99('0x7')]('%s-%s',_0x414916,_0x5b99('0x15')),'filename':filename(_0x414916,_0x5b99('0x15')),'level':_0x5b99('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4666df){return formatter(_0x414916,_0x4666df);}}),new winston[(_0x5b99('0x11'))][(_0x5b99('0x16'))]({'level':process[_0x5b99('0x17')][_0x5b99('0x18')]||debugLevel,'json':![],'formatter':function(_0x183e47){return formatter(_0x414916,_0x183e47);}})]});};