From d1613b9bfd2b4c6a5e879191b6059e105e51ed1d Mon Sep 17 00:00:00 2001 From: David Porter Date: Mon, 11 Mar 2024 13:25:31 -0700 Subject: [PATCH] minor feedback --- .../execution/mutable_state_builder.go | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/service/history/execution/mutable_state_builder.go b/service/history/execution/mutable_state_builder.go index d774da0022b..438c334fa26 100644 --- a/service/history/execution/mutable_state_builder.go +++ b/service/history/execution/mutable_state_builder.go @@ -4812,30 +4812,39 @@ func (e *mutableStateBuilder) unixNanoToTime( } func (e *mutableStateBuilder) logInfo(msg string, tags ...tag.Tag) { - if e != nil && e.executionInfo != nil { + if e != nil { + return + } + if e.executionInfo != nil { tags = append(tags, tag.WorkflowID(e.executionInfo.WorkflowID)) tags = append(tags, tag.WorkflowRunID(e.executionInfo.RunID)) tags = append(tags, tag.WorkflowDomainID(e.executionInfo.DomainID)) - e.logger.Info(msg, tags...) } + e.logger.Info(msg, tags...) } func (e *mutableStateBuilder) logWarn(msg string, tags ...tag.Tag) { - if e != nil && e.executionInfo != nil { + if e != nil { + return + } + if e.executionInfo != nil { tags = append(tags, tag.WorkflowID(e.executionInfo.WorkflowID)) tags = append(tags, tag.WorkflowRunID(e.executionInfo.RunID)) tags = append(tags, tag.WorkflowDomainID(e.executionInfo.DomainID)) - e.logger.Warn(msg, tags...) } + e.logger.Warn(msg, tags...) } func (e *mutableStateBuilder) logError(msg string, tags ...tag.Tag) { - if e != nil && e.executionInfo != nil { + if e != nil { + return + } + if e.executionInfo != nil { tags = append(tags, tag.WorkflowID(e.executionInfo.WorkflowID)) tags = append(tags, tag.WorkflowRunID(e.executionInfo.RunID)) tags = append(tags, tag.WorkflowDomainID(e.executionInfo.DomainID)) - e.logger.Error(msg, tags...) } + e.logger.Error(msg, tags...) } func (e *mutableStateBuilder) logDataInconsistency() {