diff options
author | babenko <babenko@yandex-team.com> | 2024-10-30 14:45:00 +0300 |
---|---|---|
committer | babenko <babenko@yandex-team.com> | 2024-10-30 15:52:26 +0300 |
commit | 7891efa0c4d0a1bbf82be8885a53017e06f2adf5 (patch) | |
tree | 935a947693b5d35b823e192c4b8e62f9caaa25a3 /library/cpp/yt/logging/logger.cpp | |
parent | e589edb669af5acb0efabcfa77cebb60a9b97407 (diff) | |
download | ydb-7891efa0c4d0a1bbf82be8885a53017e06f2adf5.tar.gz |
Fix regression: static anchors are not updated properly
commit_hash:ab0bd9b2d0569820e495c714baecb05145ed35bf
Diffstat (limited to 'library/cpp/yt/logging/logger.cpp')
-rw-r--r-- | library/cpp/yt/logging/logger.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/library/cpp/yt/logging/logger.cpp b/library/cpp/yt/logging/logger.cpp index 58add38429..a6a0010b3b 100644 --- a/library/cpp/yt/logging/logger.cpp +++ b/library/cpp/yt/logging/logger.cpp @@ -195,14 +195,21 @@ bool TLogger::IsEssential() const return Essential_; } -void TLogger::UpdateAnchor(TLoggingAnchor* anchor) const +void TLogger::UpdateStaticAnchor( + TLoggingAnchor* anchor, + std::atomic<bool>* anchorRegistered, + ::TSourceLocation sourceLocation, + TStringBuf message) const { + if (!anchorRegistered->exchange(true)) { + LogManager_->RegisterStaticAnchor(anchor, sourceLocation, message); + } LogManager_->UpdateAnchor(anchor); } -void TLogger::RegisterStaticAnchor(TLoggingAnchor* anchor, ::TSourceLocation sourceLocation, TStringBuf message) const +void TLogger::UpdateDynamicAnchor(TLoggingAnchor* anchor) const { - LogManager_->RegisterStaticAnchor(anchor, sourceLocation, message); + LogManager_->UpdateAnchor(anchor); } void TLogger::Write(TLogEvent&& event) const |