e251b8a2413c69105f873d3210cce62dd352e723
[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 _0x5b22=['debugLevel','moment','winston','INFO','join','/var','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','message','Logger','transports','File','%s-%s','error','info','Console','env'];(function(_0x4a21e8,_0x47df1a){var _0x3ab463=function(_0x42b07c){while(--_0x42b07c){_0x4a21e8['push'](_0x4a21e8['shift']());}};_0x3ab463(++_0x47df1a);}(_0x5b22,0x190));var _0x25b2=function(_0x1589d6,_0x3decde){_0x1589d6=_0x1589d6-0x0;var _0x55e0b9=_0x5b22[_0x1589d6];return _0x55e0b9;};'use strict';var moment=require(_0x25b2('0x0'));var winston=require(_0x25b2('0x1'));var util=require('util');var path=require('path');var debugLevel=_0x25b2('0x2');function filename(_0x3eeac7,_0x3d31fa){return path[_0x25b2('0x3')](_0x25b2('0x4'),_0x25b2('0x5'),_0x25b2('0x6'),util[_0x25b2('0x7')](_0x25b2('0x8'),_0x3eeac7,_0x3d31fa));}function formatter(_0x219500,_0x47405b){return util[_0x25b2('0x7')](_0x25b2('0x9'),moment()[_0x25b2('0x7')](_0x25b2('0xa')),_0x47405b['level']['toUpperCase'](),_0x219500,_0x47405b[_0x25b2('0xb')]);}module['exports']=function(_0x421f9e){return new winston[(_0x25b2('0xc'))]({'transports':[new winston[(_0x25b2('0xd'))][(_0x25b2('0xe'))]({'name':util[_0x25b2('0x7')](_0x25b2('0xf'),_0x421f9e,_0x25b2('0x10')),'filename':filename(_0x421f9e,'error'),'level':_0x25b2('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4a7726){return formatter(_0x421f9e,_0x4a7726);}}),new winston[(_0x25b2('0xd'))][(_0x25b2('0xe'))]({'name':util[_0x25b2('0x7')](_0x25b2('0xf'),_0x421f9e,_0x25b2('0x11')),'filename':filename(_0x421f9e,_0x25b2('0x11')),'level':_0x25b2('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x36584c){return formatter(_0x421f9e,_0x36584c);}}),new winston[(_0x25b2('0xd'))][(_0x25b2('0x12'))]({'level':process[_0x25b2('0x13')][_0x25b2('0x14')]||debugLevel,'json':![],'formatter':function(_0x32fd90){return formatter(_0x421f9e,_0x32fd90);}})]});};