Built motion from commit (unavailable).|2.5.22
[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 _0xd07c=['INFO','/var','xcally','format','%s-%s.log','message','{{{','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','path'];(function(_0x38d39a,_0x593a06){var _0x7ac00d=function(_0x9fe1ac){while(--_0x9fe1ac){_0x38d39a['push'](_0x38d39a['shift']());}};_0x7ac00d(++_0x593a06);}(_0xd07c,0x112));var _0xcd07=function(_0x400b64,_0x5eb1bf){_0x400b64=_0x400b64-0x0;var _0x1d615d=_0xd07c[_0x400b64];return _0x1d615d;};'use strict';var moment=require(_0xcd07('0x0'));var winston=require('winston');var util=require('util');var path=require(_0xcd07('0x1'));var debugLevel=_0xcd07('0x2');function filename(_0x15ec0,_0x30977f){return path['join'](_0xcd07('0x3'),'log',_0xcd07('0x4'),util[_0xcd07('0x5')](_0xcd07('0x6'),_0x15ec0,_0x30977f));}function formatter(_0x2aa4b7,_0x4b7b15){_0x4b7b15[_0xcd07('0x7')]=_0x4b7b15[_0xcd07('0x7')]['replace'](/@@{/g,_0xcd07('0x8'))[_0xcd07('0x9')](/}@@/g,_0xcd07('0xa'))[_0xcd07('0x9')](/@{/g,'{{')[_0xcd07('0x9')](/}@/g,'}}');return util[_0xcd07('0x5')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xcd07('0x5')](_0xcd07('0xb')),_0x4b7b15[_0xcd07('0xc')][_0xcd07('0xd')](),_0x2aa4b7,_0x4b7b15['message']);}module['exports']=function(_0x42e39c){return new winston[(_0xcd07('0xe'))]({'transports':[new winston[(_0xcd07('0xf'))][(_0xcd07('0x10'))]({'name':util['format'](_0xcd07('0x11'),_0x42e39c,_0xcd07('0x12')),'filename':filename(_0x42e39c,_0xcd07('0x12')),'level':_0xcd07('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5cbccd){return formatter(_0x42e39c,_0x5cbccd);}}),new winston[(_0xcd07('0xf'))][(_0xcd07('0x10'))]({'name':util[_0xcd07('0x5')](_0xcd07('0x11'),_0x42e39c,_0xcd07('0x13')),'filename':filename(_0x42e39c,_0xcd07('0x13')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2b1f6c){return formatter(_0x42e39c,_0x2b1f6c);}}),new winston['transports'][(_0xcd07('0x14'))]({'level':process[_0xcd07('0x15')][_0xcd07('0x16')]||debugLevel,'json':![],'formatter':function(_0x55c751){return formatter(_0x42e39c,_0x55c751);}})]});};