MIP_SDK
v3.0.0
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
27 #define MICROSTRAIN_LOG_LEVEL_OFF 0
28 #define MICROSTRAIN_LOG_LEVEL_FATAL 1
29 #define MICROSTRAIN_LOG_LEVEL_ERROR 2
30 #define MICROSTRAIN_LOG_LEVEL_WARN 3
31 #define MICROSTRAIN_LOG_LEVEL_INFO 4
32 #define MICROSTRAIN_LOG_LEVEL_DEBUG 5
33 #define MICROSTRAIN_LOG_LEVEL_TRACE 6
60 #ifdef MICROSTRAIN_ENABLE_LOGGING
61 #define MICROSTRAIN_LOG_INIT(callback, level, user) microstrain_logging_init(callback, level, user)
63 #define MICROSTRAIN_LOG_INIT(callback, level, user) (void)0
71 #ifdef MICROSTRAIN_ENABLE_LOGGING
72 #define MICROSTRAIN_LOG_LOG(level, ...) microstrain_logging_log(level, __VA_ARGS__)
74 #define MICROSTRAIN_LOG_LOG(level, ...) (void)0
77 #ifndef MICROSTRAIN_LOGGING_MAX_LEVEL
78 #define MICROSTRAIN_LOGGING_MAX_LEVEL MICROSTRAIN_LOG_LEVEL_WARN
88 #if MICROSTRAIN_LOGGING_MAX_LEVEL >= MICROSTRAIN_LOG_LEVEL_FATAL
89 #define MICROSTRAIN_LOG_FATAL(...) MICROSTRAIN_LOG_LOG(MICROSTRAIN_LOG_LEVEL_FATAL, __VA_ARGS__)
91 #define MICROSTRAIN_LOG_FATAL(...) (void)0
97 #if MICROSTRAIN_LOGGING_MAX_LEVEL >= MICROSTRAIN_LOG_LEVEL_ERROR
98 #define MICROSTRAIN_LOG_ERROR(...) MICROSTRAIN_LOG_LOG(MICROSTRAIN_LOG_LEVEL_ERROR, __VA_ARGS__)
100 #define MICROSTRAIN_LOG_ERROR(...) (void)0
106 #if MICROSTRAIN_LOGGING_MAX_LEVEL >= MICROSTRAIN_LOG_LEVEL_WARN
107 #define MICROSTRAIN_LOG_WARN(...) MICROSTRAIN_LOG_LOG(MICROSTRAIN_LOG_LEVEL_WARN, __VA_ARGS__)
109 #define MICROSTRAIN_LOG_WARN(...) (void)0
115 #if MICROSTRAIN_LOGGING_MAX_LEVEL >= MICROSTRAIN_LOG_LEVEL_INFO
116 #define MICROSTRAIN_LOG_INFO(...) MICROSTRAIN_LOG_LOG(MICROSTRAIN_LOG_LEVEL_INFO, __VA_ARGS__)
118 #define MICROSTRAIN_LOG_INFO(...) (void)0
124 #if MICROSTRAIN_LOGGING_MAX_LEVEL >= MICROSTRAIN_LOG_LEVEL_DEBUG
125 #define MICROSTRAIN_LOG_DEBUG(...) MICROSTRAIN_LOG_LOG(MICROSTRAIN_LOG_LEVEL_DEBUG, __VA_ARGS__)
127 #define MICROSTRAIN_LOG_DEBUG(...) (void)0
133 #if MICROSTRAIN_LOGGING_MAX_LEVEL >= MICROSTRAIN_LOG_LEVEL_TRACE
134 #define MICROSTRAIN_LOG_TRACE(...) MICROSTRAIN_LOG_LOG(MICROSTRAIN_LOG_LEVEL_TRACE, __VA_ARGS__)
136 #define MICROSTRAIN_LOG_TRACE(...) (void)0
void * microstrain_logging_user_data(void)
Gets the currently active logging user data.
Definition: logging.c:59
void microstrain_logging_log(microstrain_log_level level, const char *fmt,...)
Internal log function called by logging macros. Call MICROSTRAIN_LOG_* macros instead of using this f...
Definition: logging.c:69
uint8_t microstrain_log_level
Logging level enum.
Definition: logging.h:26
void(* microstrain_log_callback)(void *user, microstrain_log_level level, const char *fmt, va_list args)
Callback function typedef for custom logging behavior.
Definition: logging.h:42
microstrain_log_level microstrain_logging_level(void)
Gets the currently active logging level.
Definition: logging.c:49
void microstrain_logging_init(microstrain_log_callback callback, microstrain_log_level level, void *user)
Initializes the logger with a callback and user data. Call MICROSTRAIN_LOG_INIT instead of using this...
Definition: logging.c:27
microstrain_log_callback microstrain_logging_callback(void)
Gets the currently active logging callback.
Definition: logging.c:39