cdd260b30b6183daf049ea545755cad8b8b54995
[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 _0x6ec2=['level','exports','transports','File','%s-%s','error','info','env','debugLevel','moment','util','join','log','format','%s-%s.log','message','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xf2d685,_0x1e1fe4){var _0x5c542b=function(_0x1bcc4b){while(--_0x1bcc4b){_0xf2d685['push'](_0xf2d685['shift']());}};_0x5c542b(++_0x1e1fe4);}(_0x6ec2,0x121));var _0x26ec=function(_0xb26f0b,_0x9b98a9){_0xb26f0b=_0xb26f0b-0x0;var _0x4aa139=_0x6ec2[_0xb26f0b];return _0x4aa139;};'use strict';var moment=require(_0x26ec('0x0'));var winston=require('winston');var util=require(_0x26ec('0x1'));var path=require('path');var debugLevel='INFO';function filename(_0x1e5fbd,_0x4db265){return path[_0x26ec('0x2')]('/var',_0x26ec('0x3'),'xcally',util[_0x26ec('0x4')](_0x26ec('0x5'),_0x1e5fbd,_0x4db265));}function formatter(_0x1a73c9,_0x26f31c){_0x26f31c[_0x26ec('0x6')]=_0x26f31c[_0x26ec('0x6')]['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0x26ec('0x7'))[_0x26ec('0x8')](/@{/g,'{{')[_0x26ec('0x8')](/}@/g,'}}');return util[_0x26ec('0x4')](_0x26ec('0x9'),moment()[_0x26ec('0x4')](_0x26ec('0xa')),_0x26f31c[_0x26ec('0xb')]['toUpperCase'](),_0x1a73c9,_0x26f31c['message']);}module[_0x26ec('0xc')]=function(_0x15be48){return new winston['Logger']({'transports':[new winston[(_0x26ec('0xd'))][(_0x26ec('0xe'))]({'name':util['format'](_0x26ec('0xf'),_0x15be48,_0x26ec('0x10')),'filename':filename(_0x15be48,_0x26ec('0x10')),'level':_0x26ec('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1955e1){return formatter(_0x15be48,_0x1955e1);}}),new winston[(_0x26ec('0xd'))][(_0x26ec('0xe'))]({'name':util[_0x26ec('0x4')](_0x26ec('0xf'),_0x15be48,_0x26ec('0x11')),'filename':filename(_0x15be48,_0x26ec('0x11')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x423c4b){return formatter(_0x15be48,_0x423c4b);}}),new winston['transports']['Console']({'level':process[_0x26ec('0x12')][_0x26ec('0x13')]||debugLevel,'json':![],'formatter':function(_0x24fe9c){return formatter(_0x15be48,_0x24fe9c);}})]});};