Built motion from commit (unavailable).|2.5.0
[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 _0xfb7a=['moment','util','INFO','join','log','%s-%s.log','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','Logger','File','error','transports','%s-%s','info','Console','debugLevel'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xfb7a,0xc8));var _0xafb7=function(_0x255cca,_0x121536){_0x255cca=_0x255cca-0x0;var _0x16d8de=_0xfb7a[_0x255cca];return _0x16d8de;};'use strict';var moment=require(_0xafb7('0x0'));var winston=require('winston');var util=require(_0xafb7('0x1'));var path=require('path');var debugLevel=_0xafb7('0x2');function filename(_0x23fa4f,_0x159b9c){return path[_0xafb7('0x3')]('/var',_0xafb7('0x4'),'xcally',util['format'](_0xafb7('0x5'),_0x23fa4f,_0x159b9c));}function formatter(_0x9eabc1,_0xed2fab){return util[_0xafb7('0x6')](_0xafb7('0x7'),moment()['format'](_0xafb7('0x8')),_0xed2fab['level'][_0xafb7('0x9')](),_0x9eabc1,_0xed2fab[_0xafb7('0xa')]);}module[_0xafb7('0xb')]=function(_0x1272c1){return new winston[(_0xafb7('0xc'))]({'transports':[new winston['transports'][(_0xafb7('0xd'))]({'name':util[_0xafb7('0x6')]('%s-%s',_0x1272c1,_0xafb7('0xe')),'filename':filename(_0x1272c1,_0xafb7('0xe')),'level':_0xafb7('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x189ed5){return formatter(_0x1272c1,_0x189ed5);}}),new winston[(_0xafb7('0xf'))][(_0xafb7('0xd'))]({'name':util[_0xafb7('0x6')](_0xafb7('0x10'),_0x1272c1,'info'),'filename':filename(_0x1272c1,_0xafb7('0x11')),'level':_0xafb7('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4b6eb4){return formatter(_0x1272c1,_0x4b6eb4);}}),new winston[(_0xafb7('0xf'))][(_0xafb7('0x12'))]({'level':process['env'][_0xafb7('0x13')]||debugLevel,'json':![],'formatter':function(_0x266504){return formatter(_0x1272c1,_0x266504);}})]});};