40 LIRC_DEBUG = LOG_DEBUG,
42 LIRC_NOTICE = LOG_NOTICE,
43 LIRC_WARNING = LOG_WARNING,
50 #define LIRC_MAX_LOGLEVEL LIRC_TRACE2
53 #define LIRC_MIN_LOGLEVEL LIRC_ERROR
59 extern char progname[128];
62 #define DEFAULT_LOGLEVEL LIRC_INFO
66 #define logmax(l) (l > LIRC_DEBUG ? LIRC_DEBUG : static_cast <loglevel_t>(l))
68 #define logmax(l) (l > LIRC_DEBUG ? LIRC_DEBUG : l)
75 #define LOGPRINTF(level, fmt, args ...) \
76 if (level + 7 <= loglevel) \
77 logprintf(logmax(level + 7), fmt, ## args)
83 #define LOGPERROR(level, s) \
84 if (level + 7 <= loglevel) \
85 logperror(logmax(level + 7), s)
102 #define lirc_log_is_enabled_for(level) (level <= loglevel)
117 int lirc_log_reopen(
void);
150 void hexdump(
char* prefix,
unsigned char* buf,
int len);
153 #define STRINGIFY(x) #x
156 #define STR(x) STRINGIFY(x)
159 #define chk_write(fd, buf, count) \
160 do_chk_write(fd, buf, count, STR(__FILE__) ":" STR(__LINE__))
164 #define chk_read(fd, buf, count) \
165 do_chk_read(fd, buf, count, STR(__FILE__) ":" STR(__LINE__))
170 do_chk_write(
int fd,
const void* buf,
size_t count,
const char* msg)
172 if (write(fd, buf, count) == -1)
179 do_chk_read(
int fd,
void* buf,
size_t count,
const char* msg)
181 if (read(fd, buf, count) == -1)
loglevel_t string2loglevel(const char *level)
void lirc_log_set_file(const char *s)
int lirc_log_use_syslog(void)
void hexdump(char *prefix, unsigned char *buf, int len)
void logprintf(loglevel_t prio, const char *format_str,...)
int lirc_log_open(const char *progname, int _nodaemon, loglevel_t level)
loglevel_t lirc_log_defaultlevel(void)
int lirc_log_get_clientlog(const char *basename, char *buffer, ssize_t size)
void logperror(loglevel_t prio, const char *format,...)
int lirc_log_setlevel(loglevel_t level)