Skip to content

Commit bc3820e

Browse files
committed
1 parent 31c283e commit bc3820e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

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

115115
@JvmStatic
116116
fun putLog(logId: String?, logFormat: String?, vararg logArguments: String) = executor.submit {
117-
val localVars: Map<String, Any?>? = localVariables.remove(logId)
118-
val localFields: Map<String, Any?>? = fields.remove(logId)
119-
val localStaticFields: Map<String, Any?>? = staticFields.remove(logId)
120117
val logTags = LogTags.newBuilder()
121118
.addData(
122119
KeyStringValuePair.newBuilder()
@@ -133,11 +130,11 @@ object ContextReceiver {
133130
if (logArguments.isNotEmpty()) {
134131
for (i in logArguments.indices) {
135132
//todo: is it smarter to pass localVariables[arg]?
136-
var argValue = localVars?.get(logArguments[i])
133+
var argValue = localVariables.remove(logId)?.get(logArguments[i])?.second
137134
if (argValue == null) {
138-
argValue = localFields?.get(logArguments[i])
135+
argValue = fields.remove(logId)?.get(logArguments[i])?.second
139136
if (argValue == null) {
140-
argValue = localStaticFields?.get(logArguments[i])
137+
argValue = staticFields.remove(logId)?.get(logArguments[i])?.second
141138
}
142139
}
143140
val value = Optional.ofNullable(argValue).orElse("null")

0 commit comments

Comments
 (0)