SoapySDR  0.8.1-g8c6cb7c5
Vendor and platform neutral SDR interface library
Logger.h
Go to the documentation of this file.
1 
14 #pragma once
15 #include <SoapySDR/Config.h>
16 #include <stdarg.h>
17 
30 typedef enum
31 {
42 
44 #define SOAPY_SDR_SSI SOAPY_SDR_SSI
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
55 SOAPY_SDR_API void SoapySDR_log(const SoapySDRLogLevel logLevel, const char *message);
56 
63 SOAPY_SDR_API void SoapySDR_vlogf(const SoapySDRLogLevel logLevel, const char *format, va_list argList);
64 
70 static inline void SoapySDR_logf(const SoapySDRLogLevel logLevel, const char *format, ...)
71 {
72  va_list argList;
73  va_start(argList, format);
74  SoapySDR_vlogf(logLevel, format, argList);
75  va_end(argList);
76 }
77 
81 typedef void (*SoapySDRLogHandler)(const SoapySDRLogLevel logLevel, const char *message);
82 
89 
95 
100 
101 #ifdef __cplusplus
102 }
103 #endif
#define SOAPY_SDR_API
Definition: Config.h:41
static void SoapySDR_logf(const SoapySDRLogLevel logLevel, const char *format,...)
Definition: Logger.h:70
SOAPY_SDR_API void SoapySDR_log(const SoapySDRLogLevel logLevel, const char *message)
#define SOAPY_SDR_SSI
Compile-time detection macro for SSI feature.
Definition: Logger.h:44
SOAPY_SDR_API void SoapySDR_setLogLevel(const SoapySDRLogLevel logLevel)
SOAPY_SDR_API void SoapySDR_vlogf(const SoapySDRLogLevel logLevel, const char *format, va_list argList)
SoapySDRLogLevel
Definition: Logger.h:31
@ SOAPY_SDR_WARNING
A warning. An operation completed with an unexpected result.
Definition: Logger.h:35
@ SOAPY_SDR_CRITICAL
A critical error. The application might not be able to continue running successfully.
Definition: Logger.h:33
@ SOAPY_SDR_NOTICE
A notice, which is an information with just a higher priority.
Definition: Logger.h:36
@ SOAPY_SDR_INFO
An informational message, usually denoting the successful completion of an operation.
Definition: Logger.h:37
@ SOAPY_SDR_ERROR
An error. An operation did not complete successfully, but the application as a whole is not affected.
Definition: Logger.h:34
@ SOAPY_SDR_DEBUG
A debugging message.
Definition: Logger.h:38
@ SOAPY_SDR_FATAL
A fatal error. The application will most likely terminate. This is the highest priority.
Definition: Logger.h:32
@ SOAPY_SDR_TRACE
A tracing message. This is the lowest priority.
Definition: Logger.h:39
SOAPY_SDR_API void SoapySDR_registerLogHandler(const SoapySDRLogHandler handler)
void(* SoapySDRLogHandler)(const SoapySDRLogLevel logLevel, const char *message)
Definition: Logger.h:81
SOAPY_SDR_API SoapySDRLogLevel SoapySDR_getLogLevel(void)