0418336c80097f27b0b896185d50505483aa59e0
[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 _0x344d=['toUpperCase','exports','transports','%s-%s','error','File','info','Console','debugLevel','moment','winston','util','join','/var','format','%s-%s.log','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level'];(function(_0x4c7db3,_0x20a531){var _0x202824=function(_0x53adcf){while(--_0x53adcf){_0x4c7db3['push'](_0x4c7db3['shift']());}};_0x202824(++_0x20a531);}(_0x344d,0x1ab));var _0xd344=function(_0x56c2d3,_0x245571){_0x56c2d3=_0x56c2d3-0x0;var _0x21b228=_0x344d[_0x56c2d3];return _0x21b228;};'use strict';var moment=require(_0xd344('0x0'));var winston=require(_0xd344('0x1'));var util=require(_0xd344('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x11dd89,_0x3be5c0){return path[_0xd344('0x3')](_0xd344('0x4'),'log','xcally',util[_0xd344('0x5')](_0xd344('0x6'),_0x11dd89,_0x3be5c0));}function formatter(_0x1dce3b,_0x5dc1e1){_0x5dc1e1[_0xd344('0x7')]=_0x5dc1e1[_0xd344('0x7')][_0xd344('0x8')](/@@{/g,_0xd344('0x9'))[_0xd344('0x8')](/}@@/g,_0xd344('0xa'))[_0xd344('0x8')](/@{/g,'{{')[_0xd344('0x8')](/}@/g,'}}');return util[_0xd344('0x5')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xd344('0x5')](_0xd344('0xb')),_0x5dc1e1[_0xd344('0xc')][_0xd344('0xd')](),_0x1dce3b,_0x5dc1e1[_0xd344('0x7')]);}module[_0xd344('0xe')]=function(_0x4a2e48){return new winston['Logger']({'transports':[new winston[(_0xd344('0xf'))]['File']({'name':util['format'](_0xd344('0x10'),_0x4a2e48,'error'),'filename':filename(_0x4a2e48,_0xd344('0x11')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x26d59e){return formatter(_0x4a2e48,_0x26d59e);}}),new winston[(_0xd344('0xf'))][(_0xd344('0x12'))]({'name':util[_0xd344('0x5')]('%s-%s',_0x4a2e48,'info'),'filename':filename(_0x4a2e48,_0xd344('0x13')),'level':_0xd344('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4fe07c){return formatter(_0x4a2e48,_0x4fe07c);}}),new winston['transports'][(_0xd344('0x14'))]({'level':process['env'][_0xd344('0x15')]||debugLevel,'json':![],'formatter':function(_0xaa8c60){return formatter(_0x4a2e48,_0xaa8c60);}})]});};