Built motion from commit (unavailable).|2.5.1
[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 _0x416e=['info','Console','env','debugLevel','moment','path','/var','log','%s-%s.log','message','{{{','replace','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','exports','Logger','transports','%s-%s','error','File'];(function(_0xc13803,_0x13784e){var _0x215a4c=function(_0x232960){while(--_0x232960){_0xc13803['push'](_0xc13803['shift']());}};_0x215a4c(++_0x13784e);}(_0x416e,0x1d2));var _0xe416=function(_0x10f471,_0x3cc9da){_0x10f471=_0x10f471-0x0;var _0x123908=_0x416e[_0x10f471];return _0x123908;};'use strict';var moment=require(_0xe416('0x0'));var winston=require('winston');var util=require('util');var path=require(_0xe416('0x1'));var debugLevel='INFO';function filename(_0x2f7996,_0x3eec1f){return path['join'](_0xe416('0x2'),_0xe416('0x3'),'xcally',util['format'](_0xe416('0x4'),_0x2f7996,_0x3eec1f));}function formatter(_0x2d00c5,_0x199e24){_0x199e24[_0xe416('0x5')]=_0x199e24[_0xe416('0x5')]['replace'](/@@{/g,_0xe416('0x6'))[_0xe416('0x7')](/}@@/g,_0xe416('0x8'))[_0xe416('0x7')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xe416('0x9')](_0xe416('0xa'),moment()[_0xe416('0x9')](_0xe416('0xb')),_0x199e24['level']['toUpperCase'](),_0x2d00c5,_0x199e24[_0xe416('0x5')]);}module[_0xe416('0xc')]=function(_0x3ef24d){return new winston[(_0xe416('0xd'))]({'transports':[new winston[(_0xe416('0xe'))]['File']({'name':util[_0xe416('0x9')](_0xe416('0xf'),_0x3ef24d,_0xe416('0x10')),'filename':filename(_0x3ef24d,_0xe416('0x10')),'level':_0xe416('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1e5a77){return formatter(_0x3ef24d,_0x1e5a77);}}),new winston['transports'][(_0xe416('0x11'))]({'name':util[_0xe416('0x9')](_0xe416('0xf'),_0x3ef24d,'info'),'filename':filename(_0x3ef24d,'info'),'level':_0xe416('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x556f8e){return formatter(_0x3ef24d,_0x556f8e);}}),new winston[(_0xe416('0xe'))][(_0xe416('0x13'))]({'level':process[_0xe416('0x14')][_0xe416('0x15')]||debugLevel,'json':![],'formatter':function(_0xa0ac9c){return formatter(_0x3ef24d,_0xa0ac9c);}})]});};