Built motion from commit (unavailable).|2.5.15
[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 _0x8c2c=['message','{{{','}}}','replace','level','toUpperCase','exports','Logger','transports','File','error','info','env','debugLevel','winston','util','path','INFO','join','/var','format','%s-%s.log'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0x8c2c,0x92));var _0xc8c2=function(_0x55257d,_0x3998ec){_0x55257d=_0x55257d-0x0;var _0x4d296d=_0x8c2c[_0x55257d];return _0x4d296d;};'use strict';var moment=require('moment');var winston=require(_0xc8c2('0x0'));var util=require(_0xc8c2('0x1'));var path=require(_0xc8c2('0x2'));var debugLevel=_0xc8c2('0x3');function filename(_0x149d48,_0x315813){return path[_0xc8c2('0x4')](_0xc8c2('0x5'),'log','xcally',util[_0xc8c2('0x6')](_0xc8c2('0x7'),_0x149d48,_0x315813));}function formatter(_0x22177d,_0x2579ad){_0x2579ad[_0xc8c2('0x8')]=_0x2579ad['message']['replace'](/@@{/g,_0xc8c2('0x9'))['replace'](/}@@/g,_0xc8c2('0xa'))[_0xc8c2('0xb')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xc8c2('0x6')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xc8c2('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0x2579ad[_0xc8c2('0xc')][_0xc8c2('0xd')](),_0x22177d,_0x2579ad[_0xc8c2('0x8')]);}module[_0xc8c2('0xe')]=function(_0x299328){return new winston[(_0xc8c2('0xf'))]({'transports':[new winston[(_0xc8c2('0x10'))][(_0xc8c2('0x11'))]({'name':util[_0xc8c2('0x6')]('%s-%s',_0x299328,_0xc8c2('0x12')),'filename':filename(_0x299328,_0xc8c2('0x12')),'level':_0xc8c2('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4c01f8){return formatter(_0x299328,_0x4c01f8);}}),new winston['transports'][(_0xc8c2('0x11'))]({'name':util[_0xc8c2('0x6')]('%s-%s',_0x299328,_0xc8c2('0x13')),'filename':filename(_0x299328,'info'),'level':_0xc8c2('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5d2116){return formatter(_0x299328,_0x5d2116);}}),new winston['transports']['Console']({'level':process[_0xc8c2('0x14')][_0xc8c2('0x15')]||debugLevel,'json':![],'formatter':function(_0x8b7831){return formatter(_0x299328,_0x8b7831);}})]});};