Built motion from commit (unavailable).|2.5.30
[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 _0x838b=['%s-%s','error','info','Console','debugLevel','util','INFO','join','/var','log','xcally','format','%s-%s.log','message','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger','transports','File'];(function(_0x51a182,_0x5639a7){var _0x46aa3e=function(_0x287abb){while(--_0x287abb){_0x51a182['push'](_0x51a182['shift']());}};_0x46aa3e(++_0x5639a7);}(_0x838b,0xb5));var _0xb838=function(_0x313883,_0x2989d2){_0x313883=_0x313883-0x0;var _0x3990e9=_0x838b[_0x313883];return _0x3990e9;};'use strict';var moment=require('moment');var winston=require('winston');var util=require(_0xb838('0x0'));var path=require('path');var debugLevel=_0xb838('0x1');function filename(_0x525d76,_0x54de58){return path[_0xb838('0x2')](_0xb838('0x3'),_0xb838('0x4'),_0xb838('0x5'),util[_0xb838('0x6')](_0xb838('0x7'),_0x525d76,_0x54de58));}function formatter(_0x2d5d8f,_0x346e13){_0x346e13['message']=_0x346e13[_0xb838('0x8')][_0xb838('0x9')](/@@{/g,'{{{')[_0xb838('0x9')](/}@@/g,_0xb838('0xa'))[_0xb838('0x9')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xb838('0x6')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xb838('0x6')](_0xb838('0xb')),_0x346e13['level'][_0xb838('0xc')](),_0x2d5d8f,_0x346e13[_0xb838('0x8')]);}module[_0xb838('0xd')]=function(_0x43483){return new winston[(_0xb838('0xe'))]({'transports':[new winston[(_0xb838('0xf'))][(_0xb838('0x10'))]({'name':util[_0xb838('0x6')](_0xb838('0x11'),_0x43483,_0xb838('0x12')),'filename':filename(_0x43483,'error'),'level':_0xb838('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1feb94){return formatter(_0x43483,_0x1feb94);}}),new winston[(_0xb838('0xf'))][(_0xb838('0x10'))]({'name':util[_0xb838('0x6')](_0xb838('0x11'),_0x43483,_0xb838('0x13')),'filename':filename(_0x43483,_0xb838('0x13')),'level':_0xb838('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x147d0b){return formatter(_0x43483,_0x147d0b);}}),new winston['transports'][(_0xb838('0x14'))]({'level':process['env'][_0xb838('0x15')]||debugLevel,'json':![],'formatter':function(_0x57d642){return formatter(_0x43483,_0x57d642);}})]});};