NVIDIA DeepStream SDK API Reference

9.2 Release
includes/opentelemetry/sdk/common/global_log_handler.h File Reference

Go to the source code of this file.

Data Structures

class  sdk::common::internal_log::LogHandler
 
class  sdk::common::internal_log::DefaultLogHandler
 
class  sdk::common::internal_log::NoopLogHandler
 
class  sdk::common::internal_log::GlobalLogHandler
 Stores the singleton global LogHandler. More...
 

Namespaces

 sdk
 
 sdk::common
 
 sdk::common::internal_log
 

Macros

#define OTEL_INTERNAL_LOG_LEVEL_NONE   0
 
#define OTEL_INTERNAL_LOG_LEVEL_ERROR   1
 
#define OTEL_INTERNAL_LOG_LEVEL_WARN   2
 
#define OTEL_INTERNAL_LOG_LEVEL_INFO   3
 
#define OTEL_INTERNAL_LOG_LEVEL_DEBUG   4
 
#define OTEL_INTERNAL_LOG_LEVEL   OTEL_INTERNAL_LOG_LEVEL_DEBUG
 
#define OTEL_INTERNAL_LOG_DISPATCH(level, message, attributes)
 GlobalLogHandler and TracerProvider/MeterProvider/LoggerProvider are lazy singletons. More...
 
#define OTEL_INTERNAL_LOG_GET_3RD_ARG(arg1, arg2, arg3, ...)   arg3
 
#define OTEL_INTERNAL_LOG_ERROR_1_ARGS(message)
 
#define OTEL_INTERNAL_LOG_ERROR_2_ARGS(message, attributes)
 
#define OTEL_INTERNAL_LOG_ERROR_MACRO(...)
 
#define OTEL_INTERNAL_LOG_ERROR(...)   OTEL_INTERNAL_LOG_ERROR_MACRO(__VA_ARGS__)(__VA_ARGS__)
 
#define OTEL_INTERNAL_LOG_WARN_1_ARGS(message)
 
#define OTEL_INTERNAL_LOG_WARN_2_ARGS(message, attributes)
 
#define OTEL_INTERNAL_LOG_WARN_MACRO(...)
 
#define OTEL_INTERNAL_LOG_WARN(...)   OTEL_INTERNAL_LOG_WARN_MACRO(__VA_ARGS__)(__VA_ARGS__)
 
#define OTEL_INTERNAL_LOG_DEBUG_1_ARGS(message)
 
#define OTEL_INTERNAL_LOG_DEBUG_2_ARGS(message, attributes)
 
#define OTEL_INTERNAL_LOG_DEBUG_MACRO(...)
 
#define OTEL_INTERNAL_LOG_DEBUG(...)   OTEL_INTERNAL_LOG_DEBUG_MACRO(__VA_ARGS__)(__VA_ARGS__)
 
#define OTEL_INTERNAL_LOG_INFO_1_ARGS(message)
 
#define OTEL_INTERNAL_LOG_INFO_2_ARGS(message, attributes)
 
#define OTEL_INTERNAL_LOG_INFO_MACRO(...)
 
#define OTEL_INTERNAL_LOG_INFO(...)   OTEL_INTERNAL_LOG_INFO_MACRO(__VA_ARGS__)(__VA_ARGS__)
 

Enumerations

enum  sdk::common::internal_log::LogLevel {
  sdk::common::internal_log::LogLevel::None = OTEL_INTERNAL_LOG_LEVEL_NONE,
  sdk::common::internal_log::LogLevel::Error = OTEL_INTERNAL_LOG_LEVEL_ERROR,
  sdk::common::internal_log::LogLevel::Warning = OTEL_INTERNAL_LOG_LEVEL_WARN,
  sdk::common::internal_log::LogLevel::Info = OTEL_INTERNAL_LOG_LEVEL_INFO,
  sdk::common::internal_log::LogLevel::Debug = OTEL_INTERNAL_LOG_LEVEL_DEBUG,
  sdk::common::internal_log::LogLevel::None = OTEL_INTERNAL_LOG_LEVEL_NONE,
  sdk::common::internal_log::LogLevel::Error = OTEL_INTERNAL_LOG_LEVEL_ERROR,
  sdk::common::internal_log::LogLevel::Warning = OTEL_INTERNAL_LOG_LEVEL_WARN,
  sdk::common::internal_log::LogLevel::Info = OTEL_INTERNAL_LOG_LEVEL_INFO,
  sdk::common::internal_log::LogLevel::Debug = OTEL_INTERNAL_LOG_LEVEL_DEBUG
}
 

Functions

std::string sdk::common::internal_log::LevelToString (LogLevel level)
 

Macro Definition Documentation

◆ OTEL_INTERNAL_LOG_DEBUG

#define OTEL_INTERNAL_LOG_DEBUG (   ...)    OTEL_INTERNAL_LOG_DEBUG_MACRO(__VA_ARGS__)(__VA_ARGS__)

◆ OTEL_INTERNAL_LOG_DEBUG_1_ARGS

#define OTEL_INTERNAL_LOG_DEBUG_1_ARGS (   message)
Value:
OTEL_INTERNAL_LOG_DISPATCH(opentelemetry::sdk::common::internal_log::LogLevel::Debug, message, \
{})

Definition at line 192 of file includes/opentelemetry/sdk/common/global_log_handler.h.

◆ OTEL_INTERNAL_LOG_DEBUG_2_ARGS

#define OTEL_INTERNAL_LOG_DEBUG_2_ARGS (   message,
  attributes 
)
Value:
OTEL_INTERNAL_LOG_DISPATCH(opentelemetry::sdk::common::internal_log::LogLevel::Debug, message, \
attributes)

Definition at line 195 of file includes/opentelemetry/sdk/common/global_log_handler.h.

◆ OTEL_INTERNAL_LOG_DEBUG_MACRO

#define OTEL_INTERNAL_LOG_DEBUG_MACRO (   ...)

◆ OTEL_INTERNAL_LOG_DISPATCH

#define OTEL_INTERNAL_LOG_DISPATCH (   level,
  message,
  attributes 
)
Value:
do \
{ \
using opentelemetry::sdk::common::internal_log::GlobalLogHandler; \
using opentelemetry::sdk::common::internal_log::LogHandler; \
if (level > GlobalLogHandler::GetLogLevel()) \
{ \
break; \
} \
opentelemetry::nostd::shared_ptr<LogHandler> log_handler = GlobalLogHandler::GetLogHandler(); \
if (!log_handler) \
{ \
break; \
} \
std::stringstream tmp_stream; \
tmp_stream << message; \
log_handler->Handle(level, __FILE__, __LINE__, tmp_stream.str().c_str(), attributes); \
} while (false);

GlobalLogHandler and TracerProvider/MeterProvider/LoggerProvider are lazy singletons.

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.

Definition at line 140 of file includes/opentelemetry/sdk/common/global_log_handler.h.

◆ OTEL_INTERNAL_LOG_ERROR

#define OTEL_INTERNAL_LOG_ERROR (   ...)    OTEL_INTERNAL_LOG_ERROR_MACRO(__VA_ARGS__)(__VA_ARGS__)

◆ OTEL_INTERNAL_LOG_ERROR_1_ARGS

#define OTEL_INTERNAL_LOG_ERROR_1_ARGS (   message)
Value:
OTEL_INTERNAL_LOG_DISPATCH(opentelemetry::sdk::common::internal_log::LogLevel::Error, message, \
{})

Definition at line 162 of file includes/opentelemetry/sdk/common/global_log_handler.h.

◆ OTEL_INTERNAL_LOG_ERROR_2_ARGS

#define OTEL_INTERNAL_LOG_ERROR_2_ARGS (   message,
  attributes 
)
Value:
OTEL_INTERNAL_LOG_DISPATCH(opentelemetry::sdk::common::internal_log::LogLevel::Error, message, \
attributes)

Definition at line 165 of file includes/opentelemetry/sdk/common/global_log_handler.h.

◆ OTEL_INTERNAL_LOG_ERROR_MACRO

#define OTEL_INTERNAL_LOG_ERROR_MACRO (   ...)

◆ OTEL_INTERNAL_LOG_GET_3RD_ARG

#define OTEL_INTERNAL_LOG_GET_3RD_ARG (   arg1,
  arg2,
  arg3,
  ... 
)    arg3

◆ OTEL_INTERNAL_LOG_INFO

#define OTEL_INTERNAL_LOG_INFO (   ...)    OTEL_INTERNAL_LOG_INFO_MACRO(__VA_ARGS__)(__VA_ARGS__)

◆ OTEL_INTERNAL_LOG_INFO_1_ARGS

#define OTEL_INTERNAL_LOG_INFO_1_ARGS (   message)
Value:
OTEL_INTERNAL_LOG_DISPATCH(opentelemetry::sdk::common::internal_log::LogLevel::Info, message, \
{})

Definition at line 207 of file includes/opentelemetry/sdk/common/global_log_handler.h.

◆ OTEL_INTERNAL_LOG_INFO_2_ARGS

#define OTEL_INTERNAL_LOG_INFO_2_ARGS (   message,
  attributes 
)
Value:
OTEL_INTERNAL_LOG_DISPATCH(opentelemetry::sdk::common::internal_log::LogLevel::Info, message, \
attributes)

Definition at line 210 of file includes/opentelemetry/sdk/common/global_log_handler.h.

◆ OTEL_INTERNAL_LOG_INFO_MACRO

#define OTEL_INTERNAL_LOG_INFO_MACRO (   ...)

◆ OTEL_INTERNAL_LOG_LEVEL

#define OTEL_INTERNAL_LOG_LEVEL   OTEL_INTERNAL_LOG_LEVEL_DEBUG

◆ OTEL_INTERNAL_LOG_LEVEL_DEBUG

#define OTEL_INTERNAL_LOG_LEVEL_DEBUG   4

◆ OTEL_INTERNAL_LOG_LEVEL_ERROR

#define OTEL_INTERNAL_LOG_LEVEL_ERROR   1

◆ OTEL_INTERNAL_LOG_LEVEL_INFO

#define OTEL_INTERNAL_LOG_LEVEL_INFO   3

◆ OTEL_INTERNAL_LOG_LEVEL_NONE

#define OTEL_INTERNAL_LOG_LEVEL_NONE   0

◆ OTEL_INTERNAL_LOG_LEVEL_WARN

#define OTEL_INTERNAL_LOG_LEVEL_WARN   2

◆ OTEL_INTERNAL_LOG_WARN

#define OTEL_INTERNAL_LOG_WARN (   ...)    OTEL_INTERNAL_LOG_WARN_MACRO(__VA_ARGS__)(__VA_ARGS__)

◆ OTEL_INTERNAL_LOG_WARN_1_ARGS

#define OTEL_INTERNAL_LOG_WARN_1_ARGS (   message)
Value:
OTEL_INTERNAL_LOG_DISPATCH(opentelemetry::sdk::common::internal_log::LogLevel::Warning, \
message, {})

Definition at line 177 of file includes/opentelemetry/sdk/common/global_log_handler.h.

◆ OTEL_INTERNAL_LOG_WARN_2_ARGS

#define OTEL_INTERNAL_LOG_WARN_2_ARGS (   message,
  attributes 
)
Value:
OTEL_INTERNAL_LOG_DISPATCH(opentelemetry::sdk::common::internal_log::LogLevel::Warning, \
message, attributes)

Definition at line 180 of file includes/opentelemetry/sdk/common/global_log_handler.h.

◆ OTEL_INTERNAL_LOG_WARN_MACRO

#define OTEL_INTERNAL_LOG_WARN_MACRO (   ...)
OTEL_INTERNAL_LOG_WARN_2_ARGS
#define OTEL_INTERNAL_LOG_WARN_2_ARGS(message, attributes)
Definition: includes/opentelemetry/sdk/common/global_log_handler.h:180
OTEL_INTERNAL_LOG_ERROR_1_ARGS
#define OTEL_INTERNAL_LOG_ERROR_1_ARGS(message)
Definition: includes/opentelemetry/sdk/common/global_log_handler.h:162
OTEL_INTERNAL_LOG_INFO_2_ARGS
#define OTEL_INTERNAL_LOG_INFO_2_ARGS(message, attributes)
Definition: includes/opentelemetry/sdk/common/global_log_handler.h:210
OTEL_INTERNAL_LOG_ERROR_2_ARGS
#define OTEL_INTERNAL_LOG_ERROR_2_ARGS(message, attributes)
Definition: includes/opentelemetry/sdk/common/global_log_handler.h:165
OTEL_INTERNAL_LOG_GET_3RD_ARG
#define OTEL_INTERNAL_LOG_GET_3RD_ARG(arg1, arg2, arg3,...)
Definition: includes/opentelemetry/sdk/common/global_log_handler.h:159
OTEL_INTERNAL_LOG_DEBUG_1_ARGS
#define OTEL_INTERNAL_LOG_DEBUG_1_ARGS(message)
Definition: includes/opentelemetry/sdk/common/global_log_handler.h:192
OTEL_INTERNAL_LOG_INFO_1_ARGS
#define OTEL_INTERNAL_LOG_INFO_1_ARGS(message)
Definition: includes/opentelemetry/sdk/common/global_log_handler.h:207
OTEL_INTERNAL_LOG_DISPATCH
#define OTEL_INTERNAL_LOG_DISPATCH(level, message, attributes)
GlobalLogHandler and TracerProvider/MeterProvider/LoggerProvider are lazy singletons.
Definition: includes/opentelemetry/sdk/common/global_log_handler.h:140
OTEL_INTERNAL_LOG_DEBUG_2_ARGS
#define OTEL_INTERNAL_LOG_DEBUG_2_ARGS(message, attributes)
Definition: includes/opentelemetry/sdk/common/global_log_handler.h:195
OTEL_INTERNAL_LOG_WARN_1_ARGS
#define OTEL_INTERNAL_LOG_WARN_1_ARGS(message)
Definition: includes/opentelemetry/sdk/common/global_log_handler.h:177