77 virtual void log(std::chrono::system_clock::time_point timestamp,
79 std::string_view message,
127 std::string_view message,
129 bool bWithColor) noexcept;
133#define ADTF_FILE_CURRENT_SOURCE_LOCATION() \
134 adtf_file::SourceLocation \
136 __FILE__, __LINE__, __func__ \
148#define ADTF_FILE_LOG(__level, __message) \
149 adtf_file::getLogger().log(std::chrono::system_clock::now(), __level, __message, \
150 ADTF_FILE_CURRENT_SOURCE_LOCATION())
153#define ADTF_FILE_LOG_DUMP(__message) ADTF_FILE_LOG(adtf_file::LogLevel::Dump, __message)
155#define ADTF_FILE_LOG_DETAIL(__message) ADTF_FILE_LOG(adtf_file::LogLevel::Detail, __message)
157#define ADTF_FILE_LOG_INFO(__message) ADTF_FILE_LOG(adtf_file::LogLevel::Info, __message)
159#define ADTF_FILE_LOG_WARNING(__message) ADTF_FILE_LOG(adtf_file::LogLevel::Warning, __message)
161#define ADTF_FILE_LOG_ERROR(__message) ADTF_FILE_LOG(adtf_file::LogLevel::Error, __message)
182 __declspec(dllimport)
Abstract sink for log messages produced by the adtf_file library.
Definition log.h:67
virtual void log(std::chrono::system_clock::time_point timestamp, LogLevel log_level, std::string_view message, SourceLocation location) noexcept=0
Emit a single log event.
void adtfFileSetLogger(adtf_file::Logger *logger)
Injects a host-provided logger into the plugin.
namespace for ADTF File library
Definition adtf2_adtf_core_media_sample_deserializer.h:25
std::string defaultLogFormat(std::chrono::system_clock::time_point timestamp, LogLevel log_level, std::string_view message, SourceLocation location, bool bWithColor) noexcept
Formats a log event into a human-readable string.
Logger & getLogger() noexcept
Returns the active logger used by the library.
Logger & getDefaultLogger() noexcept
Returns the built-in default logger.
LogLevel
Severity levels for log messages, ordered from least to most verbose.
Definition log.h:29
@ Warning
Potentially harmful situations that do not abort processing.
Definition log.h:32
@ Info
General informational messages about normal operation.
Definition log.h:33
@ None
Logging disabled; no messages are emitted.
Definition log.h:30
@ Error
Unrecoverable errors that require immediate attention.
Definition log.h:31
@ Detail
More detailed operational messages for diagnostics.
Definition log.h:34
@ Debug
Alias for Dump.
Definition log.h:36
@ All
Enable all log levels.
Definition log.h:37
@ Dump
Verbose data dumps for deep troubleshooting.
Definition log.h:35
bool getTerminalColorSupport(FILE *output) noexcept
Queries whether the current terminal supports ANSI color sequences.
Bundles all data associated with a single log event.
Definition log.h:51
SourceLocation location
Source code location that produced the entry.
Definition log.h:55
LogLevel log_level
Severity of the message.
Definition log.h:53
std::chrono::system_clock::time_point timestamp
Wall-clock time when the event occurred.
Definition log.h:52
std::string_view message
Human-readable description of the event.
Definition log.h:54
Identifies the source code location where a log message was emitted.
Definition log.h:42
std::string_view function
Name of the enclosing function (typically __func__).
Definition log.h:46
std::string_view file
Path of the translation unit (typically __FILE__).
Definition log.h:44
size_t line
Line number within file (typically __LINE__).
Definition log.h:45