aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorasorotsky <asorotsky@yandex-team.com>2023-05-30 20:09:45 +0300
committerasorotsky <asorotsky@yandex-team.com>2023-05-30 20:09:45 +0300
commit60cfcb7841aa32f41f362af2aa3683c109ec6be0 (patch)
treefba616394a168c0bb2922a577cc47cabd73be281 /library
parentf9f178af4431ce73b021704a43cf2f9e52947a6e (diff)
downloadydb-60cfcb7841aa32f41f362af2aa3683c109ec6be0.tar.gz
prevent extra copy and format for log_s;
Diffstat (limited to 'library')
-rw-r--r--library/cpp/actors/core/log.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/cpp/actors/core/log.h b/library/cpp/actors/core/log.h
index c801666ca3..f09519e543 100644
--- a/library/cpp/actors/core/log.h
+++ b/library/cpp/actors/core/log.h
@@ -53,12 +53,12 @@
} \
} while (0) /**/
-#define LOG_LOG_S_SAMPLED_BY(actorCtxOrSystem, priority, component, sampleBy, stream) \
- LOG_LOG_SAMPLED_BY(actorCtxOrSystem, priority, component, sampleBy, "%s", [&]() { \
- TStringBuilder logStringBuilder; \
- logStringBuilder << stream; \
- return static_cast<TString>(logStringBuilder); \
- }().data())
+#define LOG_LOG_S_SAMPLED_BY(actorCtxOrSystem, priority, component, sampleBy, stream) \
+ LOG_LOG_SAMPLED_BY(actorCtxOrSystem, priority, component, sampleBy, [&]() -> TString { \
+ TStringBuilder logStringBuilder; \
+ logStringBuilder << stream; \
+ return std::move(logStringBuilder); \
+ }())
#define LOG_LOG(actorCtxOrSystem, priority, component, ...) LOG_LOG_SAMPLED_BY(actorCtxOrSystem, priority, component, 0ull, __VA_ARGS__)
#define LOG_LOG_S(actorCtxOrSystem, priority, component, stream) LOG_LOG_S_SAMPLED_BY(actorCtxOrSystem, priority, component, 0ull, stream)