forked from external/yambar
log: rename log_class() -> log_msg()
This commit is contained in:
parent
7e95862e12
commit
8897e480c5
2 changed files with 9 additions and 7 deletions
4
log.c
4
log.c
|
@ -39,8 +39,8 @@ _log(enum log_class log_class, const char *module, const char *file, int lineno,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
log_class(enum log_class log_class, const char *module,
|
log_msg(enum log_class log_class, const char *module,
|
||||||
const char *file, int lineno, const char *fmt, ...)
|
const char *file, int lineno, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
12
log.h
12
log.h
|
@ -2,20 +2,22 @@
|
||||||
|
|
||||||
enum log_class { LOG_CLASS_ERROR, LOG_CLASS_WARNING, LOG_CLASS_INFO, LOG_CLASS_DEBUG };
|
enum log_class { LOG_CLASS_ERROR, LOG_CLASS_WARNING, LOG_CLASS_INFO, LOG_CLASS_DEBUG };
|
||||||
|
|
||||||
void log_class(enum log_class log_class, const char *module,
|
void log_msg(enum log_class log_class, const char *module,
|
||||||
|
const char *file, int lineno,
|
||||||
|
const char *fmt, ...) __attribute__((format (printf, 5, 6)));
|
||||||
const char *file, int lineno,
|
const char *file, int lineno,
|
||||||
const char *fmt, ...) __attribute__((format (printf, 5, 6)));
|
const char *fmt, ...) __attribute__((format (printf, 5, 6)));
|
||||||
|
|
||||||
#define LOG_ERR(fmt, ...) \
|
#define LOG_ERR(fmt, ...) \
|
||||||
log_class(LOG_CLASS_ERROR, LOG_MODULE, __FILE__, __LINE__, fmt, ## __VA_ARGS__)
|
log_msg(LOG_CLASS_ERROR, LOG_MODULE, __FILE__, __LINE__, fmt, ## __VA_ARGS__)
|
||||||
#define LOG_WARN(fmt, ...) \
|
#define LOG_WARN(fmt, ...) \
|
||||||
log_class(LOG_CLASS_WARNING, LOG_MODULE, __FILE__, __LINE__, fmt, ## __VA_ARGS__)
|
log_msg(LOG_CLASS_WARNING, LOG_MODULE, __FILE__, __LINE__, fmt, ## __VA_ARGS__)
|
||||||
#define LOG_INFO(fmt, ...) \
|
#define LOG_INFO(fmt, ...) \
|
||||||
log_class(LOG_CLASS_INFO, LOG_MODULE, __FILE__, __LINE__, fmt, ## __VA_ARGS__)
|
log_msg(LOG_CLASS_INFO, LOG_MODULE, __FILE__, __LINE__, fmt, ## __VA_ARGS__)
|
||||||
|
|
||||||
#if defined(LOG_ENABLE_DBG) && LOG_ENABLE_DBG
|
#if defined(LOG_ENABLE_DBG) && LOG_ENABLE_DBG
|
||||||
#define LOG_DBG(fmt, ...) \
|
#define LOG_DBG(fmt, ...) \
|
||||||
log_class(LOG_CLASS_DEBUG, LOG_MODULE, __FILE__, __LINE__, fmt, ## __VA_ARGS__)
|
log_msg(LOG_CLASS_DEBUG, LOG_MODULE, __FILE__, __LINE__, fmt, ## __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define LOG_DBG(fmt, ...)
|
#define LOG_DBG(fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue