25 lines
845 B
C
25 lines
845 B
C
#ifndef __OSFP_LOG_H__
|
|
#define __OSFP_LOG_H__
|
|
|
|
enum osfp_log_level {
|
|
OSFP_LOG_LEVEL_DEBUG,
|
|
OSFP_LOG_LEVEL_INFO,
|
|
OSFP_LOG_LEVEL_WARNING,
|
|
OSFP_LOG_LEVEL_ERROR
|
|
};
|
|
|
|
#ifndef DEBUGLOG
|
|
#define osfp_log_debug(...) do { } while (0)
|
|
#else
|
|
#define osfp_log_debug(...) osfp_log(OSFP_LOG_LEVEL_DEBUG, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
|
|
#endif
|
|
#define osfp_log_info(...) osfp_log(OSFP_LOG_LEVEL_INFO, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
|
|
#define osfp_log_warning(...) osfp_log(OSFP_LOG_LEVEL_WARNING, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
|
|
#define osfp_log_error(...) osfp_log(OSFP_LOG_LEVEL_ERROR, __FILE__, __LINE__, __FUNCTION__,__VA_ARGS__)
|
|
|
|
|
|
void osfp_log_level_set(enum osfp_log_level level);
|
|
void osfp_log(unsigned int x, const char *file, const int line, const char *func, const char *fmt, ...);
|
|
|
|
#endif
|