Built motion from commit (unavailable).|2.5.19
[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 _0x5927=['util','INFO','join','xcally','format','%s-%s.log','message','{{{','replace','}}}','level','exports','Logger','transports','File','error','Console','env','debugLevel','winston'];(function(_0x46f324,_0x1e6f90){var _0x25f63b=function(_0x453418){while(--_0x453418){_0x46f324['push'](_0x46f324['shift']());}};_0x25f63b(++_0x1e6f90);}(_0x5927,0x77));var _0x7592=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0x5927[_0x3186aa];return _0x2d8c36;};'use strict';var moment=require('moment');var winston=require(_0x7592('0x0'));var util=require(_0x7592('0x1'));var path=require('path');var debugLevel=_0x7592('0x2');function filename(_0x493d3e,_0x2094fa){return path[_0x7592('0x3')]('/var','log',_0x7592('0x4'),util[_0x7592('0x5')](_0x7592('0x6'),_0x493d3e,_0x2094fa));}function formatter(_0x196971,_0x27685c){_0x27685c[_0x7592('0x7')]=_0x27685c['message']['replace'](/@@{/g,_0x7592('0x8'))[_0x7592('0x9')](/}@@/g,_0x7592('0xa'))[_0x7592('0x9')](/@{/g,'{{')[_0x7592('0x9')](/}@/g,'}}');return util[_0x7592('0x5')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x7592('0x5')]('YYYY-MM-DD\x20HH:mm:ss'),_0x27685c[_0x7592('0xb')]['toUpperCase'](),_0x196971,_0x27685c[_0x7592('0x7')]);}module[_0x7592('0xc')]=function(_0x392c14){return new winston[(_0x7592('0xd'))]({'transports':[new winston[(_0x7592('0xe'))][(_0x7592('0xf'))]({'name':util[_0x7592('0x5')]('%s-%s',_0x392c14,_0x7592('0x10')),'filename':filename(_0x392c14,_0x7592('0x10')),'level':_0x7592('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2decd0){return formatter(_0x392c14,_0x2decd0);}}),new winston[(_0x7592('0xe'))][(_0x7592('0xf'))]({'name':util['format']('%s-%s',_0x392c14,'info'),'filename':filename(_0x392c14,'info'),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x38f0a4){return formatter(_0x392c14,_0x38f0a4);}}),new winston[(_0x7592('0xe'))][(_0x7592('0x11'))]({'level':process[_0x7592('0x12')][_0x7592('0x13')]||debugLevel,'json':![],'formatter':function(_0x10ffd2){return formatter(_0x392c14,_0x10ffd2);}})]});};