Built motion from commit (unavailable).|2.4.4
[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 _0xa173=['exports','transports','File','%s-%s','error','info','Console','env','debugLevel','winston','path','INFO','join','/var','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa173,0x126));var _0x3a17=function(_0x23bad0,_0x2f68c1){_0x23bad0=_0x23bad0-0x0;var _0xf8c963=_0xa173[_0x23bad0];return _0xf8c963;};'use strict';var moment=require('moment');var winston=require(_0x3a17('0x0'));var util=require('util');var path=require(_0x3a17('0x1'));var debugLevel=_0x3a17('0x2');function filename(_0x3e99e6,_0x1b76a6){return path[_0x3a17('0x3')](_0x3a17('0x4'),'log',_0x3a17('0x5'),util[_0x3a17('0x6')](_0x3a17('0x7'),_0x3e99e6,_0x1b76a6));}function formatter(_0x409cdb,_0xc60288){return util[_0x3a17('0x6')](_0x3a17('0x8'),moment()[_0x3a17('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0xc60288['level']['toUpperCase'](),_0x409cdb,_0xc60288[_0x3a17('0x9')]);}module[_0x3a17('0xa')]=function(_0x589dad){return new winston['Logger']({'transports':[new winston[(_0x3a17('0xb'))][(_0x3a17('0xc'))]({'name':util[_0x3a17('0x6')](_0x3a17('0xd'),_0x589dad,_0x3a17('0xe')),'filename':filename(_0x589dad,'error'),'level':_0x3a17('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5097c4){return formatter(_0x589dad,_0x5097c4);}}),new winston['transports'][(_0x3a17('0xc'))]({'name':util['format'](_0x3a17('0xd'),_0x589dad,_0x3a17('0xf')),'filename':filename(_0x589dad,_0x3a17('0xf')),'level':_0x3a17('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x8cf939){return formatter(_0x589dad,_0x8cf939);}}),new winston[(_0x3a17('0xb'))][(_0x3a17('0x10'))]({'level':process[_0x3a17('0x11')][_0x3a17('0x12')]||debugLevel,'json':![],'formatter':function(_0x48fff0){return formatter(_0x589dad,_0x48fff0);}})]});};