070a4bfa555af606d142a4b4b148c9e7f66a7aa0
[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 _0x123c=['Console','env','moment','winston','util','/var','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','message','transports','File','error','%s-%s','info'];(function(_0x2141c2,_0x15c6bd){var _0x1c0c29=function(_0x30bfc5){while(--_0x30bfc5){_0x2141c2['push'](_0x2141c2['shift']());}};_0x1c0c29(++_0x15c6bd);}(_0x123c,0xce));var _0xc123=function(_0x28fdc6,_0x1cd3e6){_0x28fdc6=_0x28fdc6-0x0;var _0x2461f7=_0x123c[_0x28fdc6];return _0x2461f7;};'use strict';var moment=require(_0xc123('0x0'));var winston=require(_0xc123('0x1'));var util=require(_0xc123('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x4fe039,_0x2cf120){return path['join'](_0xc123('0x3'),'log',_0xc123('0x4'),util[_0xc123('0x5')](_0xc123('0x6'),_0x4fe039,_0x2cf120));}function formatter(_0x2abb7d,_0x4da991){return util['format'](_0xc123('0x7'),moment()[_0xc123('0x5')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4da991['level'][_0xc123('0x8')](),_0x2abb7d,_0x4da991[_0xc123('0x9')]);}module['exports']=function(_0x25c675){return new winston['Logger']({'transports':[new winston[(_0xc123('0xa'))][(_0xc123('0xb'))]({'name':util[_0xc123('0x5')]('%s-%s',_0x25c675,_0xc123('0xc')),'filename':filename(_0x25c675,_0xc123('0xc')),'level':_0xc123('0xc'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1bdaf6){return formatter(_0x25c675,_0x1bdaf6);}}),new winston[(_0xc123('0xa'))][(_0xc123('0xb'))]({'name':util[_0xc123('0x5')](_0xc123('0xd'),_0x25c675,_0xc123('0xe')),'filename':filename(_0x25c675,_0xc123('0xe')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x557dcf){return formatter(_0x25c675,_0x557dcf);}}),new winston['transports'][(_0xc123('0xf'))]({'level':process[_0xc123('0x10')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x4cbc94){return formatter(_0x25c675,_0x4cbc94);}})]});};