Built motion from commit 753c950e.|2.5.42
[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 _0x4838=['message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','transports','File','%s-%s','error','info','env','debugLevel','INFO','xcally','format','%s-%s.log'];(function(_0x3b54c0,_0x4a9967){var _0x3e23b2=function(_0x6b00f1){while(--_0x6b00f1){_0x3b54c0['push'](_0x3b54c0['shift']());}};_0x3e23b2(++_0x4a9967);}(_0x4838,0x1dc));var _0x8483=function(_0x1a50ed,_0x2d43eb){_0x1a50ed=_0x1a50ed-0x0;var _0x13b910=_0x4838[_0x1a50ed];return _0x13b910;};'use strict';var moment=require('moment');var winston=require('winston');var util=require('util');var path=require('path');var debugLevel=_0x8483('0x0');function filename(_0x226f10,_0x98eb74){return path['join']('/var','log',_0x8483('0x1'),util[_0x8483('0x2')](_0x8483('0x3'),_0x226f10,_0x98eb74));}function formatter(_0x92cac2,_0x15319d){_0x15319d[_0x8483('0x4')]=_0x15319d['message'][_0x8483('0x5')](/@@{/g,_0x8483('0x6'))[_0x8483('0x5')](/}@@/g,_0x8483('0x7'))['replace'](/@{/g,'{{')[_0x8483('0x5')](/}@/g,'}}');return util['format'](_0x8483('0x8'),moment()[_0x8483('0x2')](_0x8483('0x9')),_0x15319d[_0x8483('0xa')]['toUpperCase'](),_0x92cac2,_0x15319d['message']);}module[_0x8483('0xb')]=function(_0x2dcf15){return new winston[(_0x8483('0xc'))]({'transports':[new winston[(_0x8483('0xd'))][(_0x8483('0xe'))]({'name':util[_0x8483('0x2')](_0x8483('0xf'),_0x2dcf15,_0x8483('0x10')),'filename':filename(_0x2dcf15,_0x8483('0x10')),'level':_0x8483('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x525cc1){return formatter(_0x2dcf15,_0x525cc1);}}),new winston[(_0x8483('0xd'))][(_0x8483('0xe'))]({'name':util[_0x8483('0x2')]('%s-%s',_0x2dcf15,_0x8483('0x11')),'filename':filename(_0x2dcf15,_0x8483('0x11')),'level':_0x8483('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3ec56e){return formatter(_0x2dcf15,_0x3ec56e);}}),new winston['transports']['Console']({'level':process[_0x8483('0x12')][_0x8483('0x13')]||debugLevel,'json':![],'formatter':function(_0x58e165){return formatter(_0x2dcf15,_0x58e165);}})]});};