Skip to content

Commit

Permalink
Merge pull request #2017 from DataDog/nogorodnikov/rum-4358/log-messa…
Browse files Browse the repository at this point in the history
…ge-about-tag-modification-only-once

RUM-4358: Log warning about tag modification only once
  • Loading branch information
0xnm committed May 2, 2024
2 parents d9e9cad + be760da commit c0eb3d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class DatadogDataConstraints(private val internalLogger: InternalLogger) : DataC
internalLogger.log(
InternalLogger.Level.WARN,
InternalLogger.Target.USER,
{ "tag \"$it\" was modified to \"$tag\" to match our constraints." }
{ "tag \"$it\" was modified to \"$tag\" to match our constraints." },
onlyOnce = true
)
}
tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ internal class DatadogDataConstraintsTest {
mockInternalLogger.verifyLog(
InternalLogger.Level.WARN,
InternalLogger.Target.USER,
"tag \"$tag\" was modified to \"$expectedCorrectedTag\" to match our constraints."
"tag \"$tag\" was modified to \"$expectedCorrectedTag\" to match our constraints.",
onlyOnce = true
)
}

Expand All @@ -112,7 +113,8 @@ internal class DatadogDataConstraintsTest {
mockInternalLogger.verifyLog(
InternalLogger.Level.WARN,
InternalLogger.Target.USER,
"tag \"$tag\" was modified to \"$expectedCorrectedTag\" to match our constraints."
"tag \"$tag\" was modified to \"$expectedCorrectedTag\" to match our constraints.",
onlyOnce = true
)
}

Expand All @@ -128,7 +130,8 @@ internal class DatadogDataConstraintsTest {
mockInternalLogger.verifyLog(
InternalLogger.Level.WARN,
InternalLogger.Target.USER,
"tag \"$tag\" was modified to \"$expectedCorrectedTag\" to match our constraints."
"tag \"$tag\" was modified to \"$expectedCorrectedTag\" to match our constraints.",
onlyOnce = true
)
}

Expand All @@ -144,7 +147,8 @@ internal class DatadogDataConstraintsTest {
InternalLogger.Level.WARN,
InternalLogger.Target.USER,
"tag \"$expectedCorrectedTag:\" was modified to " +
"\"$expectedCorrectedTag\" to match our constraints."
"\"$expectedCorrectedTag\" to match our constraints.",
onlyOnce = true
)
}

Expand Down

0 comments on commit c0eb3d8

Please sign in to comment.