Built motion from commit (unavailable).|2.5.14
[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 _0x5475=['log','xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','Logger','%s-%s','error','transports','File','info','Console','env','moment','winston','util','path','INFO','join','/var'];(function(_0x415264,_0x4e71cc){var _0x305b9e=function(_0x25bde5){while(--_0x25bde5){_0x415264['push'](_0x415264['shift']());}};_0x305b9e(++_0x4e71cc);}(_0x5475,0x9b));var _0x5547=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5475[_0x160c73];return _0xd9302;};'use strict';var moment=require(_0x5547('0x0'));var winston=require(_0x5547('0x1'));var util=require(_0x5547('0x2'));var path=require(_0x5547('0x3'));var debugLevel=_0x5547('0x4');function filename(_0x208b6d,_0x32ee5f){return path[_0x5547('0x5')](_0x5547('0x6'),_0x5547('0x7'),_0x5547('0x8'),util[_0x5547('0x9')](_0x5547('0xa'),_0x208b6d,_0x32ee5f));}function formatter(_0x53dceb,_0x5209db){_0x5209db[_0x5547('0xb')]=_0x5209db[_0x5547('0xb')][_0x5547('0xc')](/@@{/g,_0x5547('0xd'))[_0x5547('0xc')](/}@@/g,_0x5547('0xe'))[_0x5547('0xc')](/@{/g,'{{')[_0x5547('0xc')](/}@/g,'}}');return util[_0x5547('0x9')](_0x5547('0xf'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x5209db[_0x5547('0x10')][_0x5547('0x11')](),_0x53dceb,_0x5209db[_0x5547('0xb')]);}module[_0x5547('0x12')]=function(_0x2634a4){return new winston[(_0x5547('0x13'))]({'transports':[new winston['transports']['File']({'name':util[_0x5547('0x9')](_0x5547('0x14'),_0x2634a4,_0x5547('0x15')),'filename':filename(_0x2634a4,_0x5547('0x15')),'level':_0x5547('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4a5b3c){return formatter(_0x2634a4,_0x4a5b3c);}}),new winston[(_0x5547('0x16'))][(_0x5547('0x17'))]({'name':util[_0x5547('0x9')](_0x5547('0x14'),_0x2634a4,_0x5547('0x18')),'filename':filename(_0x2634a4,_0x5547('0x18')),'level':_0x5547('0x18'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4fba23){return formatter(_0x2634a4,_0x4fba23);}}),new winston['transports'][(_0x5547('0x19'))]({'level':process[_0x5547('0x1a')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x5131e9){return formatter(_0x2634a4,_0x5131e9);}})]});};