Built motion from commit (unavailable).|2.5.26
[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 _0x65a5=['winston','path','join','/var','xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','%s-%s','error','File','info','Console','debugLevel','moment'];(function(_0x141103,_0x56f880){var _0x3d47e3=function(_0x3e081a){while(--_0x3e081a){_0x141103['push'](_0x141103['shift']());}};_0x3d47e3(++_0x56f880);}(_0x65a5,0x175));var _0x565a=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x65a5[_0x754ab4];return _0x34079a;};'use strict';var moment=require(_0x565a('0x0'));var winston=require(_0x565a('0x1'));var util=require('util');var path=require(_0x565a('0x2'));var debugLevel='INFO';function filename(_0x4235c0,_0x4543b4){return path[_0x565a('0x3')](_0x565a('0x4'),'log',_0x565a('0x5'),util[_0x565a('0x6')](_0x565a('0x7'),_0x4235c0,_0x4543b4));}function formatter(_0x10357f,_0x206df1){_0x206df1['message']=_0x206df1[_0x565a('0x8')][_0x565a('0x9')](/@@{/g,_0x565a('0xa'))['replace'](/}@@/g,_0x565a('0xb'))[_0x565a('0x9')](/@{/g,'{{')[_0x565a('0x9')](/}@/g,'}}');return util[_0x565a('0x6')](_0x565a('0xc'),moment()[_0x565a('0x6')](_0x565a('0xd')),_0x206df1['level'][_0x565a('0xe')](),_0x10357f,_0x206df1[_0x565a('0x8')]);}module[_0x565a('0xf')]=function(_0x171752){return new winston['Logger']({'transports':[new winston['transports']['File']({'name':util['format'](_0x565a('0x10'),_0x171752,'error'),'filename':filename(_0x171752,_0x565a('0x11')),'level':_0x565a('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5b9e0c){return formatter(_0x171752,_0x5b9e0c);}}),new winston['transports'][(_0x565a('0x12'))]({'name':util[_0x565a('0x6')](_0x565a('0x10'),_0x171752,_0x565a('0x13')),'filename':filename(_0x171752,_0x565a('0x13')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x41b10c){return formatter(_0x171752,_0x41b10c);}}),new winston['transports'][(_0x565a('0x14'))]({'level':process['env'][_0x565a('0x15')]||debugLevel,'json':![],'formatter':function(_0x590ded){return formatter(_0x171752,_0x590ded);}})]});};