Built motion from commit (unavailable).|2.4.12
[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 _0x6c86=['[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','message','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','path','join','/var','xcally','format','%s-%s.log'];(function(_0x4e4bb5,_0x210412){var _0x327f8f=function(_0x51fb9c){while(--_0x51fb9c){_0x4e4bb5['push'](_0x4e4bb5['shift']());}};_0x327f8f(++_0x210412);}(_0x6c86,0x10b));var _0x66c8=function(_0x26c279,_0x1ce9b8){_0x26c279=_0x26c279-0x0;var _0x196f8b=_0x6c86[_0x26c279];return _0x196f8b;};'use strict';var moment=require(_0x66c8('0x0'));var winston=require(_0x66c8('0x1'));var util=require(_0x66c8('0x2'));var path=require(_0x66c8('0x3'));var debugLevel='INFO';function filename(_0x175fe3,_0x5bb55b){return path[_0x66c8('0x4')](_0x66c8('0x5'),'log',_0x66c8('0x6'),util[_0x66c8('0x7')](_0x66c8('0x8'),_0x175fe3,_0x5bb55b));}function formatter(_0x2ccb8d,_0x26d8c7){return util[_0x66c8('0x7')](_0x66c8('0x9'),moment()[_0x66c8('0x7')](_0x66c8('0xa')),_0x26d8c7[_0x66c8('0xb')]['toUpperCase'](),_0x2ccb8d,_0x26d8c7[_0x66c8('0xc')]);}module[_0x66c8('0xd')]=function(_0x2f54f5){return new winston[(_0x66c8('0xe'))]({'transports':[new winston[(_0x66c8('0xf'))][(_0x66c8('0x10'))]({'name':util['format'](_0x66c8('0x11'),_0x2f54f5,_0x66c8('0x12')),'filename':filename(_0x2f54f5,_0x66c8('0x12')),'level':_0x66c8('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x40fb0b){return formatter(_0x2f54f5,_0x40fb0b);}}),new winston['transports']['File']({'name':util[_0x66c8('0x7')](_0x66c8('0x11'),_0x2f54f5,_0x66c8('0x13')),'filename':filename(_0x2f54f5,_0x66c8('0x13')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2e2eea){return formatter(_0x2f54f5,_0x2e2eea);}}),new winston[(_0x66c8('0xf'))][(_0x66c8('0x14'))]({'level':process[_0x66c8('0x15')][_0x66c8('0x16')]||debugLevel,'json':![],'formatter':function(_0x2f8fab){return formatter(_0x2f54f5,_0x2f8fab);}})]});};