849b6aafaa644b1a49c0087f64376370db86d487
[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 _0x104e=['env','util','INFO','join','/var','log','format','YYYY-MM-DD\x20HH:mm:ss','level','Logger','error','%s-%s','info','transports','Console'];(function(_0xeed167,_0x30cd34){var _0x49d5af=function(_0x5517c1){while(--_0x5517c1){_0xeed167['push'](_0xeed167['shift']());}};_0x49d5af(++_0x30cd34);}(_0x104e,0x1c3));var _0xe104=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x104e[_0x1fc122];return _0xa2cb13;};'use strict';var moment=require('moment');var winston=require('winston');var util=require(_0xe104('0x0'));var path=require('path');var debugLevel=_0xe104('0x1');function filename(_0x15eecb,_0x279af5){return path[_0xe104('0x2')](_0xe104('0x3'),_0xe104('0x4'),'xcally',util[_0xe104('0x5')]('%s-%s.log',_0x15eecb,_0x279af5));}function formatter(_0x1dc7a7,_0x8a91ec){return util[_0xe104('0x5')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xe104('0x5')](_0xe104('0x6')),_0x8a91ec[_0xe104('0x7')]['toUpperCase'](),_0x1dc7a7,_0x8a91ec['message']);}module['exports']=function(_0x28c33b){return new winston[(_0xe104('0x8'))]({'transports':[new winston['transports']['File']({'name':util[_0xe104('0x5')]('%s-%s',_0x28c33b,_0xe104('0x9')),'filename':filename(_0x28c33b,'error'),'level':_0xe104('0x9'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x403ea9){return formatter(_0x28c33b,_0x403ea9);}}),new winston['transports']['File']({'name':util[_0xe104('0x5')](_0xe104('0xa'),_0x28c33b,_0xe104('0xb')),'filename':filename(_0x28c33b,_0xe104('0xb')),'level':_0xe104('0xb'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x28df58){return formatter(_0x28c33b,_0x28df58);}}),new winston[(_0xe104('0xc'))][(_0xe104('0xd'))]({'level':process[_0xe104('0xe')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x58ab11){return formatter(_0x28c33b,_0x58ab11);}})]});};