Commit 5816a6b8ae7def6262234f362ddf2da6759b1012

Authored by Adhidarma Hadiwinoto
1 parent 7bf43b7065
Exists in master

optimized logging

Showing 1 changed file with 3 additions and 5 deletions Side-by-side Diff

... ... @@ -59,8 +59,6 @@ function topupRequest(task) {
59 59  
60 60 request(options, function (error, response, body) {
61 61  
62   - logger.info(logTag + ': DIRECT RESPONSE');
63   -
64 62 if (error) {
65 63  
66 64 var error_message = 'Error on http connection to gateway: ' + error;
... ... @@ -88,7 +86,7 @@ function topupRequest(task) {
88 86 return;
89 87 }
90 88  
91   - logger.info(result);
  89 + logger.info('Got direct response from request', {result: result});
92 90  
93 91 try {
94 92 responseMessage = result.direct_ack.info[0];
... ... @@ -107,9 +105,9 @@ function topupRequest(task) {
107 105  
108 106 }
109 107 catch(err) {
110   - logger.warn('Exception on parsing request response');
  108 + logger.warn('Exception on parsing xml response');
111 109 responseCode = 40;
112   - responseMessage = 'Invalid response from gateway';
  110 + responseMessage = 'Invalid xml response from gateway';
113 111 }
114 112  
115 113 callbackReport(task['requestId'], responseCode, responseMessage);