Built motion from commit (unavailable).|2.5.4
[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 _0x7ca5=['info','transports','Console','env','debugLevel','moment','winston','path','INFO','join','/var','log','xcally','%s-%s.log','format','level','toUpperCase','Logger','error','File','%s-%s'];(function(_0x2aff26,_0x3edbc6){var _0x4ccf1a=function(_0x2f3b68){while(--_0x2f3b68){_0x2aff26['push'](_0x2aff26['shift']());}};_0x4ccf1a(++_0x3edbc6);}(_0x7ca5,0xc2));var _0x57ca=function(_0x4b563a,_0xed87cd){_0x4b563a=_0x4b563a-0x0;var _0x27c794=_0x7ca5[_0x4b563a];return _0x27c794;};'use strict';var moment=require(_0x57ca('0x0'));var winston=require(_0x57ca('0x1'));var util=require('util');var path=require(_0x57ca('0x2'));var debugLevel=_0x57ca('0x3');function filename(_0x1d369b,_0xf8df59){return path[_0x57ca('0x4')](_0x57ca('0x5'),_0x57ca('0x6'),_0x57ca('0x7'),util['format'](_0x57ca('0x8'),_0x1d369b,_0xf8df59));}function formatter(_0x412eaf,_0x219612){return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x57ca('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),_0x219612[_0x57ca('0xa')][_0x57ca('0xb')](),_0x412eaf,_0x219612['message']);}module['exports']=function(_0x1522b3){return new winston[(_0x57ca('0xc'))]({'transports':[new winston['transports']['File']({'name':util['format']('%s-%s',_0x1522b3,_0x57ca('0xd')),'filename':filename(_0x1522b3,_0x57ca('0xd')),'level':_0x57ca('0xd'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x51712f){return formatter(_0x1522b3,_0x51712f);}}),new winston['transports'][(_0x57ca('0xe'))]({'name':util[_0x57ca('0x9')](_0x57ca('0xf'),_0x1522b3,_0x57ca('0x10')),'filename':filename(_0x1522b3,_0x57ca('0x10')),'level':_0x57ca('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1335fd){return formatter(_0x1522b3,_0x1335fd);}}),new winston[(_0x57ca('0x11'))][(_0x57ca('0x12'))]({'level':process[_0x57ca('0x13')][_0x57ca('0x14')]||debugLevel,'json':![],'formatter':function(_0x54bc71){return formatter(_0x1522b3,_0x54bc71);}})]});};