Built motion from commit 14588770.|2.5.38
[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 _0xf53e=['debugLevel','moment','winston','util','path','join','/var','log','xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','Logger','transports','%s-%s','error','File','info','Console','env'];(function(_0x5f5fae,_0x3e67d6){var _0x336802=function(_0x4362d8){while(--_0x4362d8){_0x5f5fae['push'](_0x5f5fae['shift']());}};_0x336802(++_0x3e67d6);}(_0xf53e,0x17b));var _0xef53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf53e[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xef53('0x0'));var winston=require(_0xef53('0x1'));var util=require(_0xef53('0x2'));var path=require(_0xef53('0x3'));var debugLevel='INFO';function filename(_0x5c42e6,_0x353d76){return path[_0xef53('0x4')](_0xef53('0x5'),_0xef53('0x6'),_0xef53('0x7'),util[_0xef53('0x8')](_0xef53('0x9'),_0x5c42e6,_0x353d76));}function formatter(_0x5c9223,_0x3d5f12){_0x3d5f12[_0xef53('0xa')]=_0x3d5f12[_0xef53('0xa')][_0xef53('0xb')](/@@{/g,_0xef53('0xc'))[_0xef53('0xb')](/}@@/g,_0xef53('0xd'))[_0xef53('0xb')](/@{/g,'{{')[_0xef53('0xb')](/}@/g,'}}');return util[_0xef53('0x8')](_0xef53('0xe'),moment()[_0xef53('0x8')](_0xef53('0xf')),_0x3d5f12[_0xef53('0x10')][_0xef53('0x11')](),_0x5c9223,_0x3d5f12['message']);}module['exports']=function(_0x2a3e53){return new winston[(_0xef53('0x12'))]({'transports':[new winston[(_0xef53('0x13'))]['File']({'name':util[_0xef53('0x8')](_0xef53('0x14'),_0x2a3e53,_0xef53('0x15')),'filename':filename(_0x2a3e53,_0xef53('0x15')),'level':_0xef53('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x35f905){return formatter(_0x2a3e53,_0x35f905);}}),new winston['transports'][(_0xef53('0x16'))]({'name':util[_0xef53('0x8')]('%s-%s',_0x2a3e53,_0xef53('0x17')),'filename':filename(_0x2a3e53,_0xef53('0x17')),'level':_0xef53('0x17'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1eb7cd){return formatter(_0x2a3e53,_0x1eb7cd);}}),new winston[(_0xef53('0x13'))][(_0xef53('0x18'))]({'level':process[_0xef53('0x19')][_0xef53('0x1a')]||debugLevel,'json':![],'formatter':function(_0x36d5b1){return formatter(_0x2a3e53,_0x36d5b1);}})]});};