Skip to content

Commit

Permalink
Update debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Annie Lee committed Mar 18, 2022
1 parent 24ee8c5 commit 79a418d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ class TransportGetDestinationsAction @Inject constructor(
for (hit in response.hits) {
// TODO: Remove debug logs
log.info("hit: $hit")
log.info("hit.sourceAsString: $hit.sourceAsString")
val source = hit.sourceAsString
log.info("hit.sourceAsString: $source")
val id = hit.id
val version = hit.version
val seqNo = hit.seqNo.toInt()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,15 @@ class TransportGetFindingsSearchAction @Inject constructor(
log.info("Parsing hits.")
log.info("hit: $hit")
val id = hit.id
log.info("hit.sourceAsString: $hit.sourceAsString")
val source = hit.sourceAsString
log.info("hit.sourceAsString: $source")
val xcp = XContentFactory.xContent(XContentType.JSON)
.createParser(xContentRegistry, LoggingDeprecationHandler.INSTANCE, hit.sourceAsString)
XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, xcp.nextToken(), xcp)
XContentParserUtils.ensureExpectedToken(XContentParser.Token.FIELD_NAME, xcp.nextToken(), xcp)
XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, xcp.nextToken(), xcp)
// TODO: Remove debug log
log.info("Adding new finding with id: $id")
findings.add(Finding.parse(xcp, id))
}
actionListener.onResponse(GetFindingsSearchResponse(RestStatus.OK, totalFindingCount, findings))
Expand Down

0 comments on commit 79a418d

Please sign in to comment.