Built motion from commit (unavailable).|2.5.31
[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 _0x9792=['winston','util','INFO','log','format','%s-%s.log','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','error','File','%s-%s','info','Console','env','debugLevel','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9792,0x8f));var _0x2979=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9792[_0x40a045];return _0x1a687c;};'use strict';var moment=require(_0x2979('0x0'));var winston=require(_0x2979('0x1'));var util=require(_0x2979('0x2'));var path=require('path');var debugLevel=_0x2979('0x3');function filename(_0xcf042b,_0x18734e){return path['join']('/var',_0x2979('0x4'),'xcally',util[_0x2979('0x5')](_0x2979('0x6'),_0xcf042b,_0x18734e));}function formatter(_0x408048,_0x1cfef0){_0x1cfef0[_0x2979('0x7')]=_0x1cfef0[_0x2979('0x7')][_0x2979('0x8')](/@@{/g,_0x2979('0x9'))[_0x2979('0x8')](/}@@/g,_0x2979('0xa'))[_0x2979('0x8')](/@{/g,'{{')[_0x2979('0x8')](/}@/g,'}}');return util[_0x2979('0x5')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format'](_0x2979('0xb')),_0x1cfef0[_0x2979('0xc')][_0x2979('0xd')](),_0x408048,_0x1cfef0[_0x2979('0x7')]);}module[_0x2979('0xe')]=function(_0x1b16bc){return new winston[(_0x2979('0xf'))]({'transports':[new winston[(_0x2979('0x10'))]['File']({'name':util[_0x2979('0x5')]('%s-%s',_0x1b16bc,'error'),'filename':filename(_0x1b16bc,_0x2979('0x11')),'level':_0x2979('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1ac5b0){return formatter(_0x1b16bc,_0x1ac5b0);}}),new winston['transports'][(_0x2979('0x12'))]({'name':util[_0x2979('0x5')](_0x2979('0x13'),_0x1b16bc,'info'),'filename':filename(_0x1b16bc,'info'),'level':_0x2979('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x59500c){return formatter(_0x1b16bc,_0x59500c);}}),new winston[(_0x2979('0x10'))][(_0x2979('0x15'))]({'level':process[_0x2979('0x16')][_0x2979('0x17')]||debugLevel,'json':![],'formatter':function(_0x321956){return formatter(_0x1b16bc,_0x321956);}})]});};