Built motion from commit (unavailable).|2.3.1
[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 _0x7582=['info','env','debugLevel','moment','winston','join','log','format','%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','message','exports','File','%s-%s','error','transports'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0x7582,0xe3));var _0x2758=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0x7582[_0x4b4638];return _0x59e92b;};'use strict';var moment=require(_0x2758('0x0'));var winston=require(_0x2758('0x1'));var util=require('util');var path=require('path');var debugLevel='INFO';function filename(_0x2e7b66,_0x438eb4){return path[_0x2758('0x2')]('/var',_0x2758('0x3'),'xcally',util[_0x2758('0x4')](_0x2758('0x5'),_0x2e7b66,_0x438eb4));}function formatter(_0x3e6945,_0x3a8e2c){return util[_0x2758('0x4')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x2758('0x4')](_0x2758('0x6')),_0x3a8e2c['level']['toUpperCase'](),_0x3e6945,_0x3a8e2c[_0x2758('0x7')]);}module[_0x2758('0x8')]=function(_0x383934){return new winston['Logger']({'transports':[new winston['transports'][(_0x2758('0x9'))]({'name':util[_0x2758('0x4')](_0x2758('0xa'),_0x383934,'error'),'filename':filename(_0x383934,_0x2758('0xb')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x11de0c){return formatter(_0x383934,_0x11de0c);}}),new winston[(_0x2758('0xc'))][(_0x2758('0x9'))]({'name':util[_0x2758('0x4')]('%s-%s',_0x383934,'info'),'filename':filename(_0x383934,_0x2758('0xd')),'level':_0x2758('0xd'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1e81fe){return formatter(_0x383934,_0x1e81fe);}}),new winston['transports']['Console']({'level':process[_0x2758('0xe')][_0x2758('0xf')]||debugLevel,'json':![],'formatter':function(_0x11a75b){return formatter(_0x383934,_0x11a75b);}})]});};