15#ifndef IOX2_BB_REPORTING_LOG_BUILDING_BLOCKS_LOGGER_HPP
16#define IOX2_BB_REPORTING_LOG_BUILDING_BLOCKS_LOGGER_HPP
70template <
typename BaseLogger>
110 concurrent::Atomic<
bool> m_isActive {
true };
119#include "iox2/legacy/detail/log/building_blocks/logger.inl"
A thin wrapper for a 'std::atomic' which ensures that all atomic operations are always lock-free in o...
This class provides the public interface to the logger and is used with the 'IOX2_LOG' macro....
This class acts as common interface for the Logger. It provides the common functionality and inherits...
static void init(const LogLevel logLevel=logLevelFromEnvOr(LogLevel::Info)) noexcept
Initializes the logger.
Logger(const Logger &)=delete
static void setActiveLogger(Logger &newLogger) noexcept
Replaces the default logger with the specified one.
Logger & operator=(Logger &&)=delete
static Logger & get() noexcept
Access to the logger singleton instance.
Logger & operator=(const Logger &)=delete
bool equalStrings(const char *lhs, const char(&rhs)[N]) noexcept
Compares C-style strings with a char array, i.g. string literal for equality.
LogLevel
This enum defines the log levels used for logging.
LogLevel logLevelFromEnvOr(const LogLevel logLevel) noexcept
Tries to get the log level from the 'IOX2_LOG_LEVEL' env variable or uses the specified one if the en...
constexpr const char * asStringLiteral(const LogLevel value) noexcept
converts LogLevel into a string literal
constexpr bool always_false_v
Helper value to bind a static_assert to a type.
void log(LogLevel log_level, const char *origin, const char *message)
Adds a log message to the logger.