Skip to content

Commit a912c2e

Browse files
committed
1 parent bc3820e commit a912c2e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

services/src/main/kotlin/spp/probe/services/common/ContextReceiver.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ object ContextReceiver {
114114

115115
@JvmStatic
116116
fun putLog(logId: String?, logFormat: String?, vararg logArguments: String) = executor.submit {
117+
val localVars = localVariables.remove(logId)
118+
val localFields = fields.remove(logId)
119+
val localStaticFields = staticFields.remove(logId)
117120
val logTags = LogTags.newBuilder()
118121
.addData(
119122
KeyStringValuePair.newBuilder()
@@ -130,11 +133,11 @@ object ContextReceiver {
130133
if (logArguments.isNotEmpty()) {
131134
for (i in logArguments.indices) {
132135
//todo: is it smarter to pass localVariables[arg]?
133-
var argValue = localVariables.remove(logId)?.get(logArguments[i])?.second
136+
var argValue = localVars?.get(logArguments[i])?.second
134137
if (argValue == null) {
135-
argValue = fields.remove(logId)?.get(logArguments[i])?.second
138+
argValue = localFields?.get(logArguments[i])?.second
136139
if (argValue == null) {
137-
argValue = staticFields.remove(logId)?.get(logArguments[i])?.second
140+
argValue = localStaticFields?.get(logArguments[i])?.second
138141
}
139142
}
140143
val value = Optional.ofNullable(argValue).orElse("null")

0 commit comments

Comments
 (0)