3662bc29b0f393aca33f3db23cf0f343c573cc04
[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 _0x0877=['[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','Logger','transports','File','%s-%s','info','Console','env','debugLevel','moment','winston','util','path','INFO','join','/var','log','xcally','%s-%s.log','format'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x0877,0xbb));var _0x7087=function(_0x4dfecb,_0x8d2259){_0x4dfecb=_0x4dfecb-0x0;var _0x4fc85c=_0x0877[_0x4dfecb];return _0x4fc85c;};'use strict';var moment=require(_0x7087('0x0'));var winston=require(_0x7087('0x1'));var util=require(_0x7087('0x2'));var path=require(_0x7087('0x3'));var debugLevel=_0x7087('0x4');function filename(_0x25d125,_0x1853af){return path[_0x7087('0x5')](_0x7087('0x6'),_0x7087('0x7'),_0x7087('0x8'),util['format'](_0x7087('0x9'),_0x25d125,_0x1853af));}function formatter(_0x32eaa2,_0x3cb1ab){return util[_0x7087('0xa')](_0x7087('0xb'),moment()[_0x7087('0xa')](_0x7087('0xc')),_0x3cb1ab[_0x7087('0xd')]['toUpperCase'](),_0x32eaa2,_0x3cb1ab['message']);}module['exports']=function(_0x58ebf9){return new winston[(_0x7087('0xe'))]({'transports':[new winston[(_0x7087('0xf'))][(_0x7087('0x10'))]({'name':util[_0x7087('0xa')](_0x7087('0x11'),_0x58ebf9,'error'),'filename':filename(_0x58ebf9,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3542b0){return formatter(_0x58ebf9,_0x3542b0);}}),new winston[(_0x7087('0xf'))][(_0x7087('0x10'))]({'name':util[_0x7087('0xa')](_0x7087('0x11'),_0x58ebf9,_0x7087('0x12')),'filename':filename(_0x58ebf9,_0x7087('0x12')),'level':_0x7087('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x116ce1){return formatter(_0x58ebf9,_0x116ce1);}}),new winston[(_0x7087('0xf'))][(_0x7087('0x13'))]({'level':process[_0x7087('0x14')][_0x7087('0x15')]||debugLevel,'json':![],'formatter':function(_0x2ab23d){return formatter(_0x58ebf9,_0x2ab23d);}})]});};