Commit b5fbb0644fcf48c38dde8353d52deb089d4e05ed
1 parent
818cf50b
Exists in
master
and in
1 other branch
update log debug
Showing
2 changed files
with
18 additions
and
1 deletions
Show diff stats
ais-structure/src/modules/helper/connection.js
| ... | ... | @@ -11,6 +11,8 @@ var connection = []; |
| 11 | 11 | |
| 12 | 12 | connection.requestSoapToSACF = async function (soap,cmd,myMethod) { |
| 13 | 13 | |
| 14 | + log.log("Connect to SACF") | |
| 15 | + | |
| 14 | 16 | var service = cfg.service.SACF; |
| 15 | 17 | var retry = service[myMethod+"_"+cmd+"_Retry"]; |
| 16 | 18 | |
| ... | ... | @@ -21,6 +23,8 @@ connection.requestSoapToSACF = async function (soap,cmd,myMethod) { |
| 21 | 23 | timeout : cfg.service.SACF[myMethod+"_"+cmd+"_Timeout"]*1000 |
| 22 | 24 | } |
| 23 | 25 | |
| 26 | + log.log(JSON.stringify(params)) | |
| 27 | + | |
| 24 | 28 | if(!retry) |
| 25 | 29 | retry = cfg.Default_Retry; |
| 26 | 30 | |
| ... | ... | @@ -47,6 +51,8 @@ connection.requestSoapToSACF = async function (soap,cmd,myMethod) { |
| 47 | 51 | |
| 48 | 52 | connection.requestJsonToD01 = async function (obj,cmd,myMethod) { |
| 49 | 53 | |
| 54 | + log.log("Connect to D01") | |
| 55 | + | |
| 50 | 56 | var service = cfg.service.D01; |
| 51 | 57 | var retry = service[myMethod+"_"+cmd+"_Retry"]; |
| 52 | 58 | if(!retry) |
| ... | ... | @@ -65,6 +71,8 @@ connection.requestJsonToD01 = async function (obj,cmd,myMethod) { |
| 65 | 71 | timeout : service[myMethod+"_"+cmd+"_Timeout"]*1000 |
| 66 | 72 | } |
| 67 | 73 | |
| 74 | + log.log(JSON.stringify(params)) | |
| 75 | + | |
| 68 | 76 | var funStats = function(){ |
| 69 | 77 | stats.sendRestRequest(service.Name,myMethod,cmd); |
| 70 | 78 | log.logDetail.addOutput(service.Name,myMethod+"_"+cmd,constants.Request,params,obj); |
| ... | ... | @@ -469,6 +477,8 @@ function checkResponse(result,funStats) |
| 469 | 477 | funStats.error(result.response) |
| 470 | 478 | } |
| 471 | 479 | |
| 480 | + log.log(JSON.stringify(result)); | |
| 481 | + | |
| 472 | 482 | return result; |
| 473 | 483 | } |
| 474 | 484 | ... | ... |
ais-structure/src/modules/helper/validator.js
| 1 | +var log = require('../helper/log.js'); | |
| 2 | + | |
| 1 | 3 | module.exports = function (req,list){ |
| 2 | 4 | // [true,"queryStr","commandId","int"] |
| 3 | 5 | var err = []; |
| 4 | 6 | |
| 5 | 7 | var row = []; |
| 6 | 8 | var data; |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 7 | 12 | for(var i=0;i<list.length;i++) |
| 8 | 13 | { |
| 9 | 14 | row = list[i]; |
| 10 | - data = getData(req,list[i]) | |
| 15 | + data = getData(req,list[i]) | |
| 16 | + | |
| 17 | + log.log("#Validate parameter {"+row[2]+"}"); | |
| 11 | 18 | |
| 12 | 19 | // console.log(row[2]+" : "+data); |
| 13 | 20 | ... | ... |