1#ifndef NOTCURSES_LOGGING
2#define NOTCURSES_LOGGING
11static inline void nclog(
const char*
fmt, ...)
15nclog(const
char*
fmt, ...){
18 vfprintf(stderr,
fmt, va);
22#define logpanic(fmt, ...) do{ \
23 if(loglevel >= NCLOGLEVEL_PANIC){ \
24 nclog("%s:%d:" fmt NL, __func__, __LINE__, ##__VA_ARGS__); } \
27#define logfatal(fmt, ...) do{ \
28 if(loglevel >= NCLOGLEVEL_FATAL){ \
29 nclog("%s:%d:" fmt NL, __func__, __LINE__, ##__VA_ARGS__); } \
32#define logerror(fmt, ...) do{ \
33 if(loglevel >= NCLOGLEVEL_ERROR){ \
34 nclog("%s:%d:" fmt NL, __func__, __LINE__, ##__VA_ARGS__); } \
37#define logwarn(fmt, ...) do{ \
38 if(loglevel >= NCLOGLEVEL_WARNING){ \
39 nclog("%s:%d:" fmt NL, __func__, __LINE__, ##__VA_ARGS__); } \
42#define loginfo(fmt, ...) do{ \
43 if(loglevel >= NCLOGLEVEL_INFO){ \
44 nclog("%s:%d:" fmt NL, __func__, __LINE__, ##__VA_ARGS__); } \
47#define logverbose(fmt, ...) do{ \
48 if(loglevel >= NCLOGLEVEL_VERBOSE){ \
49 nclog("%s:%d:" fmt NL, __func__, __LINE__, ##__VA_ARGS__); } \
52#define logdebug(fmt, ...) do{ \
53 if(loglevel >= NCLOGLEVEL_DEBUG){ \
54 nclog("%s:%d:" fmt NL, __func__, __LINE__, ##__VA_ARGS__); } \
57#define logtrace(fmt, ...) do{ \
58 if(loglevel >= NCLOGLEVEL_TRACE){ \
59 nclog("%s:%d:" fmt NL, __func__, __LINE__, ##__VA_ARGS__); } \
__attribute__((nonnull(1, 2))) static inline int egcpool_stash(egcpool *pool
const char va_start(va, fmt)