Skip to content

Commit

Permalink
Update Finding.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Annie Lee committed Mar 17, 2022
1 parent 5a72a6c commit 24ee8c5
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package org.opensearch.alerting.model

import org.apache.logging.log4j.LogManager
import org.opensearch.alerting.elasticapi.instant
import org.opensearch.common.io.stream.StreamInput
import org.opensearch.common.io.stream.StreamOutput
Expand All @@ -16,6 +17,8 @@ import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken
import java.io.IOException
import java.time.Instant

private val log = LogManager.getLogger(Finding::class.java)

/**
* A wrapper of the log event that enriches the event by also including information about the monitor it triggered.
*/
Expand All @@ -32,6 +35,7 @@ class Finding(
val triggerId: String?,
val triggerName: String?
) : Writeable, ToXContent {

@Throws(IOException::class)
constructor(sin: StreamInput) : this(
id = sin.readString(),
Expand Down Expand Up @@ -127,6 +131,8 @@ class Finding(
while (xcp.nextToken() != XContentParser.Token.END_OBJECT) {
val fieldName = xcp.currentName()
xcp.nextToken()
// TODO: Remove debug log
log.info("fieldName: $fieldName")

when (fieldName) {
RELATED_DOC_ID_FIELD -> relatedDocId = xcp.text()
Expand Down

0 comments on commit 24ee8c5

Please sign in to comment.