Built motion from commit 67e5df37.|2.0.66
[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 _0x2b98=['File','%s-%s','error','info','Console','env','debugLevel','winston','util','path','INFO','join','/var','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','Logger','transports'];(function(_0x3cc1b9,_0x5b1e24){var _0x28a622=function(_0x5cb98a){while(--_0x5cb98a){_0x3cc1b9['push'](_0x3cc1b9['shift']());}};_0x28a622(++_0x5b1e24);}(_0x2b98,0x10f));var _0x82b9=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x2b98[_0x92c450];return _0x2a9599;};'use strict';var moment=require('moment');var winston=require(_0x82b9('0x0'));var util=require(_0x82b9('0x1'));var path=require(_0x82b9('0x2'));var debugLevel=_0x82b9('0x3');function filename(_0x730853,_0x2df154){return path[_0x82b9('0x4')](_0x82b9('0x5'),_0x82b9('0x6'),_0x82b9('0x7'),util[_0x82b9('0x8')](_0x82b9('0x9'),_0x730853,_0x2df154));}function formatter(_0x51ba46,_0x3680cc){return util['format'](_0x82b9('0xa'),moment()['format'](_0x82b9('0xb')),_0x3680cc[_0x82b9('0xc')][_0x82b9('0xd')](),_0x51ba46,_0x3680cc[_0x82b9('0xe')]);}module['exports']=function(_0x571c94){return new winston[(_0x82b9('0xf'))]({'transports':[new winston[(_0x82b9('0x10'))][(_0x82b9('0x11'))]({'name':util['format'](_0x82b9('0x12'),_0x571c94,_0x82b9('0x13')),'filename':filename(_0x571c94,_0x82b9('0x13')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x138f74){return formatter(_0x571c94,_0x138f74);}}),new winston[(_0x82b9('0x10'))]['File']({'name':util[_0x82b9('0x8')](_0x82b9('0x12'),_0x571c94,_0x82b9('0x14')),'filename':filename(_0x571c94,_0x82b9('0x14')),'level':_0x82b9('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2760b9){return formatter(_0x571c94,_0x2760b9);}}),new winston['transports'][(_0x82b9('0x15'))]({'level':process[_0x82b9('0x16')][_0x82b9('0x17')]||debugLevel,'json':![],'formatter':function(_0x261afd){return formatter(_0x571c94,_0x261afd);}})]});};