Skip to content

Commit

Permalink
Merge pull request #29 from SoftwareAG/feature-new-samples
Browse files Browse the repository at this point in the history
Added logOutput
  • Loading branch information
sagIoTPower committed May 13, 2024
2 parents db43df6 + 6fd9cdd commit 47cfb6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions repository/blocks/EnhancedHttpOutputBlock.mon
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ event EnhancedHTTPOutput {
/** Handle the HTTP response.*/
action handleResponse(Response res) {
$base.createTimer(($parameters.timeout.toFloat() / 1000.0), res); // Creates a timer with the specified duration.
log "Called handleResponse: " + res.payload.data.toString() at INFO;
if not res.isSuccess() {
log "Unable to connect " +$parameters.host+". Error code: " + res.statusMessage at WARN;
}
Expand All @@ -198,11 +198,11 @@ event EnhancedHTTPOutput {
Response response := <Response> $payload;
dictionary<string, any> propertyValues := {};
any k;
log "Response raw: " +response.payload.data.toString() at INFO;
log "Response raw: " + response.payload.data.toString() at INFO;
for k in response.payload.data.getKeys() {
propertyValues[k.valueToString()] := response.payload.data.getEntry(k);
}
log "Response parsed: " +propertyValues.toString() at INFO;
log "Response parsed: " + propertyValues.toString() at INFO;

$setOutput_responseBody($activation, Value(true, $activation.timestamp, propertyValues));
$setOutput_statusCode($activation, response.statusCode.toFloat());
Expand Down

0 comments on commit 47cfb6a

Please sign in to comment.