10e0430391b455fc95afbf484d056453b3bbe4d5
[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 _0x020a=['transports','File','%s-%s','error','info','env','INFO','join','/var','log','xcally','format','%s-%s.log','toUpperCase','message','exports','Logger'];(function(_0x1798c5,_0x40a00f){var _0x4d4d95=function(_0x58b00f){while(--_0x58b00f){_0x1798c5['push'](_0x1798c5['shift']());}};_0x4d4d95(++_0x40a00f);}(_0x020a,0x15a));var _0xa020=function(_0x296144,_0x26bbbf){_0x296144=_0x296144-0x0;var _0x5329b1=_0x020a[_0x296144];return _0x5329b1;};'use strict';var moment=require('moment');var winston=require('winston');var util=require('util');var path=require('path');var debugLevel=_0xa020('0x0');function filename(_0x28cbc4,_0x578b1c){return path[_0xa020('0x1')](_0xa020('0x2'),_0xa020('0x3'),_0xa020('0x4'),util[_0xa020('0x5')](_0xa020('0x6'),_0x28cbc4,_0x578b1c));}function formatter(_0x323323,_0x3d46c5){return util[_0xa020('0x5')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xa020('0x5')]('YYYY-MM-DD\x20HH:mm:ss'),_0x3d46c5['level'][_0xa020('0x7')](),_0x323323,_0x3d46c5[_0xa020('0x8')]);}module[_0xa020('0x9')]=function(_0x10d65b){return new winston[(_0xa020('0xa'))]({'transports':[new winston[(_0xa020('0xb'))][(_0xa020('0xc'))]({'name':util[_0xa020('0x5')](_0xa020('0xd'),_0x10d65b,_0xa020('0xe')),'filename':filename(_0x10d65b,_0xa020('0xe')),'level':_0xa020('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xb40a2d){return formatter(_0x10d65b,_0xb40a2d);}}),new winston['transports'][(_0xa020('0xc'))]({'name':util['format'](_0xa020('0xd'),_0x10d65b,_0xa020('0xf')),'filename':filename(_0x10d65b,_0xa020('0xf')),'level':_0xa020('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2abc5e){return formatter(_0x10d65b,_0x2abc5e);}}),new winston[(_0xa020('0xb'))]['Console']({'level':process[_0xa020('0x10')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x3418e4){return formatter(_0x10d65b,_0x3418e4);}})]});};