Built motion from commit 9d7072cc.|2.5.39
[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 _0xaf07=['[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','path','INFO','/var','log','xcally','%s-%s.log','message','{{{','replace','format'];(function(_0x216015,_0x4fc2da){var _0x5ab0a4=function(_0x4289ca){while(--_0x4289ca){_0x216015['push'](_0x216015['shift']());}};_0x5ab0a4(++_0x4fc2da);}(_0xaf07,0xee));var _0x7af0=function(_0x458478,_0x5346d8){_0x458478=_0x458478-0x0;var _0x362ec9=_0xaf07[_0x458478];return _0x362ec9;};'use strict';var moment=require(_0x7af0('0x0'));var winston=require(_0x7af0('0x1'));var util=require('util');var path=require(_0x7af0('0x2'));var debugLevel=_0x7af0('0x3');function filename(_0x1c4600,_0x5e3c7c){return path['join'](_0x7af0('0x4'),_0x7af0('0x5'),_0x7af0('0x6'),util['format'](_0x7af0('0x7'),_0x1c4600,_0x5e3c7c));}function formatter(_0x41cfe6,_0x54db55){_0x54db55[_0x7af0('0x8')]=_0x54db55[_0x7af0('0x8')]['replace'](/@@{/g,_0x7af0('0x9'))['replace'](/}@@/g,'}}}')[_0x7af0('0xa')](/@{/g,'{{')[_0x7af0('0xa')](/}@/g,'}}');return util[_0x7af0('0xb')](_0x7af0('0xc'),moment()[_0x7af0('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),_0x54db55[_0x7af0('0xd')][_0x7af0('0xe')](),_0x41cfe6,_0x54db55['message']);}module[_0x7af0('0xf')]=function(_0x3e8db1){return new winston[(_0x7af0('0x10'))]({'transports':[new winston[(_0x7af0('0x11'))][(_0x7af0('0x12'))]({'name':util['format'](_0x7af0('0x13'),_0x3e8db1,_0x7af0('0x14')),'filename':filename(_0x3e8db1,_0x7af0('0x14')),'level':_0x7af0('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4b367a){return formatter(_0x3e8db1,_0x4b367a);}}),new winston[(_0x7af0('0x11'))][(_0x7af0('0x12'))]({'name':util['format'](_0x7af0('0x13'),_0x3e8db1,_0x7af0('0x15')),'filename':filename(_0x3e8db1,_0x7af0('0x15')),'level':_0x7af0('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x52b902){return formatter(_0x3e8db1,_0x52b902);}}),new winston[(_0x7af0('0x11'))][(_0x7af0('0x16'))]({'level':process[_0x7af0('0x17')][_0x7af0('0x18')]||debugLevel,'json':![],'formatter':function(_0xe19493){return formatter(_0x3e8db1,_0xe19493);}})]});};