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 _0x7e64=['%s-%s','info','Console','env','debugLevel','winston','util','path','INFO','/var','log','xcally','%s-%s.log','format','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','Logger','File','error','transports'];(function(_0x2376d1,_0x38eec4){var _0x443759=function(_0x73c733){while(--_0x73c733){_0x2376d1['push'](_0x2376d1['shift']());}};_0x443759(++_0x38eec4);}(_0x7e64,0xcd));var _0x47e6=function(_0x13b549,_0x4c5392){_0x13b549=_0x13b549-0x0;var _0x2ef77a=_0x7e64[_0x13b549];return _0x2ef77a;};'use strict';var moment=require('moment');var winston=require(_0x47e6('0x0'));var util=require(_0x47e6('0x1'));var path=require(_0x47e6('0x2'));var debugLevel=_0x47e6('0x3');function filename(_0x2f9846,_0x3ba4dc){return path['join'](_0x47e6('0x4'),_0x47e6('0x5'),_0x47e6('0x6'),util['format'](_0x47e6('0x7'),_0x2f9846,_0x3ba4dc));}function formatter(_0x261638,_0x26d064){return util[_0x47e6('0x8')](_0x47e6('0x9'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x26d064['level'][_0x47e6('0xa')](),_0x261638,_0x26d064['message']);}module['exports']=function(_0x12fd65){return new winston[(_0x47e6('0xb'))]({'transports':[new winston['transports'][(_0x47e6('0xc'))]({'name':util[_0x47e6('0x8')]('%s-%s',_0x12fd65,'error'),'filename':filename(_0x12fd65,_0x47e6('0xd')),'level':_0x47e6('0xd'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x364c19){return formatter(_0x12fd65,_0x364c19);}}),new winston[(_0x47e6('0xe'))]['File']({'name':util[_0x47e6('0x8')](_0x47e6('0xf'),_0x12fd65,_0x47e6('0x10')),'filename':filename(_0x12fd65,'info'),'level':_0x47e6('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x194575){return formatter(_0x12fd65,_0x194575);}}),new winston[(_0x47e6('0xe'))][(_0x47e6('0x11'))]({'level':process[_0x47e6('0x12')][_0x47e6('0x13')]||debugLevel,'json':![],'formatter':function(_0x17bc8e){return formatter(_0x12fd65,_0x17bc8e);}})]});};