From 503298eb8acbdf8b2afdbb725ea6a7e64e447958 Mon Sep 17 00:00:00 2001 From: Konstantin Tyukalov Date: Wed, 10 Apr 2024 20:08:32 +0400 Subject: [PATCH] Add tag for not masked message --- src/Agent.Worker/ExecutionContext.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Agent.Worker/ExecutionContext.cs b/src/Agent.Worker/ExecutionContext.cs index ffcb6d7ccf..32397343f6 100644 --- a/src/Agent.Worker/ExecutionContext.cs +++ b/src/Agent.Worker/ExecutionContext.cs @@ -696,7 +696,11 @@ private string GetWorkspaceIdentifier(Pipelines.AgentJobRequestMessage message) // the rule is command messages - which should be crafted using strongly typed wrapper methods. public long Write(string tag, string inputMessage, bool canMaskSecrets = true) { - string message = canMaskSecrets ? HostContext.SecretMasker.MaskSecrets($"{tag}{inputMessage}") : inputMessage; + string message = $"{tag}{inputMessage}"; + if (canMaskSecrets) + { + message = HostContext.SecretMasker.MaskSecrets(message); + } long totalLines; lock (_loggerLock)