3#include "telemetry.hpp"
7#define CVB_TELEMETRY_BEGIN_INLINE_NS \
8 inline namespace CVB_TELEMETRY_MODULE_NAMESPACE \
10#define CVB_TELEMETRY_END_INLINE_NS }
12#ifndef CVB_TELEMETRY_MODULE_NAMESPACE
13# define CVB_TELEMETRY_MODULE_NAMESPACE undefined
15#define CVB_TELEMETRY_END_INLINE_NS }
27 CVB_TELEMETRY_BEGIN_INLINE_NS
57 CExports::CVTGetModule(name.c_str(), version.c_str(), handle_, config_);
73 return CExports::CVTTR_On == config_.Tracing;
83 return config_.Logging == CExports::CVTLO_On;
95 return WouldLog() && config_.LogLevel <=
static_cast<CExports::CVTLogLevel
>(logLevel);
149 void *Handle() const noexcept
154 CExports::CVTModuleConfig config_;
155 CExports::CVTMODULE handle_ =
nullptr;
158 CVB_TELEMETRY_END_INLINE_NS
A log object to stream messages.
Definition log.hpp:20
A telemetry module or artifact.
Definition module.hpp:40
bool WouldLogFatal() const noexcept
Get if fatal logs are active.
Definition module.hpp:143
static Module & Get()
Get the module singleton.
bool WouldLogInfo() const noexcept
Get if info logs are active.
Definition module.hpp:113
bool WouldLog() const noexcept
Get if logs are active.
Definition module.hpp:81
bool WouldTrace() const noexcept
Get if traces are active.
Definition module.hpp:71
bool WouldLogAtLevel(Telemetry::LogLevel logLevel) const noexcept
Get if logs at the specified level are active.
Definition module.hpp:93
bool WouldLogWarning() const noexcept
Get if warning logs are active.
Definition module.hpp:123
bool WouldLogError() const noexcept
Get if error logs are active.
Definition module.hpp:133
bool WouldLogDebug() const noexcept
Get if debug logs are active.
Definition module.hpp:103
A span object to report traces.
Definition span.hpp:19
Namespace for telemetry.
Definition attribute_map.hpp:16
LogLevel
Log level for telemetry.
Definition telemetry.hpp:32
@ LevelFatal
Logs indicating errors, that cannot be ignored.
Definition telemetry.hpp:42
@ LevelInfo
Logs informing about the current state.
Definition telemetry.hpp:36
@ LevelWarn
Logs warning about the current state, as it is out of the ordinary.
Definition telemetry.hpp:38
@ LevelDebug
Logs for debugging, these should be avoided especially in a critical code paths.
Definition telemetry.hpp:34
@ LevelError
Logs indicating errors, that may be ignored.
Definition telemetry.hpp:40
Root namespace for the Image Manager interface.
Definition version.hpp:11