Built motion from commit (unavailable).|2.5.14
[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 _0x1dbe=['%s-%s','error','info','Console','debugLevel','winston','util','path','INFO','xcally','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','File'];(function(_0x4f043d,_0x50ec68){var _0x4577d8=function(_0x2da2db){while(--_0x2da2db){_0x4f043d['push'](_0x4f043d['shift']());}};_0x4577d8(++_0x50ec68);}(_0x1dbe,0x10d));var _0xe1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbe[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var winston=require(_0xe1db('0x0'));var util=require(_0xe1db('0x1'));var path=require(_0xe1db('0x2'));var debugLevel=_0xe1db('0x3');function filename(_0x68180c,_0x14ea9b){return path['join']('/var','log',_0xe1db('0x4'),util['format'](_0xe1db('0x5'),_0x68180c,_0x14ea9b));}function formatter(_0x359d6f,_0x106fda){_0x106fda[_0xe1db('0x6')]=_0x106fda['message'][_0xe1db('0x7')](/@@{/g,_0xe1db('0x8'))[_0xe1db('0x7')](/}@@/g,_0xe1db('0x9'))[_0xe1db('0x7')](/@{/g,'{{')[_0xe1db('0x7')](/}@/g,'}}');return util['format'](_0xe1db('0xa'),moment()[_0xe1db('0xb')](_0xe1db('0xc')),_0x106fda[_0xe1db('0xd')]['toUpperCase'](),_0x359d6f,_0x106fda[_0xe1db('0x6')]);}module[_0xe1db('0xe')]=function(_0x56b62c){return new winston[(_0xe1db('0xf'))]({'transports':[new winston['transports'][(_0xe1db('0x10'))]({'name':util[_0xe1db('0xb')](_0xe1db('0x11'),_0x56b62c,_0xe1db('0x12')),'filename':filename(_0x56b62c,_0xe1db('0x12')),'level':_0xe1db('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x589a37){return formatter(_0x56b62c,_0x589a37);}}),new winston['transports'][(_0xe1db('0x10'))]({'name':util[_0xe1db('0xb')](_0xe1db('0x11'),_0x56b62c,_0xe1db('0x13')),'filename':filename(_0x56b62c,'info'),'level':_0xe1db('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5ad6f3){return formatter(_0x56b62c,_0x5ad6f3);}}),new winston['transports'][(_0xe1db('0x14'))]({'level':process['env'][_0xe1db('0x15')]||debugLevel,'json':![],'formatter':function(_0x18590e){return formatter(_0x56b62c,_0x18590e);}})]});};