From ad0415cc0de8ea6cc42f49c4d0ce0b691683d434 Mon Sep 17 00:00:00 2001 From: Lalit Date: Mon, 14 Nov 2022 10:04:22 -0800 Subject: [PATCH] fix comment on the initialization order --- .../opentelemetry/sdk/common/global_log_handler.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sdk/include/opentelemetry/sdk/common/global_log_handler.h b/sdk/include/opentelemetry/sdk/common/global_log_handler.h index 99cf48b820..e8291322b9 100644 --- a/sdk/include/opentelemetry/sdk/common/global_log_handler.h +++ b/sdk/include/opentelemetry/sdk/common/global_log_handler.h @@ -134,11 +134,10 @@ class GlobalLogHandler OPENTELEMETRY_END_NAMESPACE /** - * We can not decide the destroying order of signaltons. - * Which means, the destructors of other singletons (GlobalLogHandler,TracerProvider and etc.) - * may be called after destroying of global LogHandler and use OTEL_INTERNAL_LOG_* in it.We can do - * nothing but ignore the log in this situation. - */ + * GlobalLogHandler and TracerProvider/MeterProvider/LoggerProvider are lazy sigletons. + * To ensure that GlobalLogHandler is the first one to be initialized (and so last to be + * destroyed), it is first used inside the constructors of TraceProvider, MeterProvider + * and LoggerProvider for debug logging. */ #define OTEL_INTERNAL_LOG_DISPATCH(level, message, attributes) \ do \ { \