Loading...
Searching...
No Matches
Logger.h
Go to the documentation of this file.
#pragma once
#include <SoapySDR/Config.h>
#include <stdarg.h>
typedef enum
{
SOAPY_SDR_FATAL = 1,
SOAPY_SDR_CRITICAL = 2,
SOAPY_SDR_ERROR = 3,
SOAPY_SDR_WARNING = 4,
SOAPY_SDR_NOTICE = 5,
SOAPY_SDR_INFO = 6,
SOAPY_SDR_DEBUG = 7,
SOAPY_SDR_TRACE = 8,
SOAPY_SDR_SSI = 9,
} SoapySDRLogLevel;
#define SOAPY_SDR_SSI SOAPY_SDR_SSI
#ifdef __cplusplus
extern "C" {
#endif
SOAPY_SDR_API void SoapySDR_log(const SoapySDRLogLevel logLevel, const char *message);
SOAPY_SDR_API void SoapySDR_vlogf(const SoapySDRLogLevel logLevel, const char *format, va_list argList);
static inline void SoapySDR_logf(const SoapySDRLogLevel logLevel, const char *format, ...)
{
va_list argList;
va_start(argList, format);
SoapySDR_vlogf(logLevel, format, argList);
va_end(argList);
}
typedef void (*SoapySDRLogHandler)(const SoapySDRLogLevel logLevel, const char *message);
SOAPY_SDR_API void SoapySDR_registerLogHandler(const SoapySDRLogHandler handler);
SOAPY_SDR_API void SoapySDR_setLogLevel(const SoapySDRLogLevel logLevel);
#ifdef __cplusplus
}
#endif
Config.h
SOAPY_SDR_API
#define SOAPY_SDR_API
Definition Config.h:41
SoapySDR_logf
static void SoapySDR_logf(const SoapySDRLogLevel logLevel, const char *format,...)
Definition Logger.h:69
SoapySDR_log
SOAPY_SDR_API void SoapySDR_log(const SoapySDRLogLevel logLevel, const char *message)
SOAPY_SDR_SSI
#define SOAPY_SDR_SSI
Compile-time detection macro for SSI feature.
Definition Logger.h:43
SoapySDR_setLogLevel
SOAPY_SDR_API void SoapySDR_setLogLevel(const SoapySDRLogLevel logLevel)
SoapySDR_vlogf
SOAPY_SDR_API void SoapySDR_vlogf(const SoapySDRLogLevel logLevel, const char *format, va_list argList)
SoapySDRLogLevel
SoapySDRLogLevel
Definition Logger.h:30
SOAPY_SDR_WARNING
@ SOAPY_SDR_WARNING
A warning. An operation completed with an unexpected result.
Definition Logger.h:34
SOAPY_SDR_CRITICAL
@ SOAPY_SDR_CRITICAL
A critical error. The application might not be able to continue running successfully.
Definition Logger.h:32
SOAPY_SDR_NOTICE
@ SOAPY_SDR_NOTICE
A notice, which is an information with just a higher priority.
Definition Logger.h:35
SOAPY_SDR_INFO
@ SOAPY_SDR_INFO
An informational message, usually denoting the successful completion of an operation.
Definition Logger.h:36
SOAPY_SDR_ERROR
@ SOAPY_SDR_ERROR
An error. An operation did not complete successfully, but the application as a whole is not affected.
Definition Logger.h:33
SOAPY_SDR_DEBUG
@ SOAPY_SDR_DEBUG
A debugging message.
Definition Logger.h:37
SOAPY_SDR_FATAL
@ SOAPY_SDR_FATAL
A fatal error. The application will most likely terminate. This is the highest priority.
Definition Logger.h:31
SOAPY_SDR_TRACE
@ SOAPY_SDR_TRACE
A tracing message. This is the lowest priority.
Definition Logger.h:38
SoapySDR_registerLogHandler
SOAPY_SDR_API void SoapySDR_registerLogHandler(const SoapySDRLogHandler handler)
SoapySDRLogHandler
void(* SoapySDRLogHandler)(const SoapySDRLogLevel logLevel, const char *message)
Definition Logger.h:80