Soletta machine learning
Machine learning for IoT devices
 All Data Structures Files Functions Typedefs Enumerations Enumerator Groups Pages
Macros | Typedefs | Enumerations | Functions
sml_log.h File Reference

Go to the source code of this file.

Macros

#define sml_critical(...)   sml_log_print(SML_LOG_LEVEL_CRITICAL, __VA_ARGS__)
 Syntactic sugar to sml_log_print(SML_LOG_LEVEL_CRITICAL, "critical message") More...
 
#define sml_debug(...)   sml_log_print(SML_LOG_LEVEL_DEBUG, __VA_ARGS__)
 Syntactic sugar to sml_log_print(SML_LOG_LEVEL_DEBUG, "debug message") More...
 
#define sml_error(...)   sml_log_print(SML_LOG_LEVEL_ERROR, __VA_ARGS__)
 Syntactic sugar to sml_log_print(SML_LOG_LEVEL_ERROR, "error message") More...
 
#define sml_info(...)   sml_log_print(SML_LOG_LEVEL_INFO, __VA_ARGS__)
 Syntactic sugar to sml_log_print(SML_LOG_LEVEL_INFO, "info message") More...
 
#define sml_warning(...)   sml_log_print(SML_LOG_LEVEL_WARNING, __VA_ARGS__)
 Syntactic sugar to sml_log_print(SML_LOG_LEVEL_WARNING, "warning message") More...
 

Typedefs

typedef void(* sml_log_handler_cb )(enum sml_log_level level, const char *msg, void *data)
 Log handler callback. More...
 

Enumerations

enum  sml_log_level {
  SML_LOG_LEVEL_DEBUG = 1 << 0, SML_LOG_LEVEL_INFO = 1 << 1, SML_LOG_LEVEL_WARNING = 1 << 2, SML_LOG_LEVEL_ERROR = 1 << 3,
  SML_LOG_LEVEL_CRITICAL = 1 << 4, SML_LOG_LEVEL_ALL = (SML_LOG_LEVEL_DEBUG | SML_LOG_LEVEL_INFO | SML_LOG_LEVEL_WARNING | SML_LOG_LEVEL_ERROR | SML_LOG_LEVEL_CRITICAL)
}
 Log level types. More...
 

Functions

void sml_log_print (enum sml_log_level level, const char *format,...)
 Prints a message with a desired log level. More...
 
void sml_log_set_log_handler (enum sml_log_level levels, sml_log_handler_cb cb, void *data)
 Set a log handler. More...