diff options
| -rw-r--r-- | include/qntan/Qntan.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index 580b280..9232817 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -271,12 +271,52 @@ struct Qntan_Scheduler { +#ifndef Qntan_Logger_fatal +# define Qntan_Logger_fatal(A, ...) do{if(A){(*(A))->fatal(A, __VA_ARGS__);}}while(0) +#endif +#ifndef Qntan_Logger_error +# define Qntan_Logger_error(A, ...) do{if(A){(*(A))->error(A, __VA_ARGS__);}}while(0) +#endif +#ifndef Qntan_Logger_warn +# define Qntan_Logger_warn(A, ...) do{if(A){(*(A))->warn(A, __VA_ARGS__);}}while(0) +#endif +#ifndef Qntan_Logger_info +# define Qntan_Logger_info(A, ...) do{if(A){(*(A))->info(A, __VA_ARGS__);}}while(0) +#endif +#ifndef Qntan_Logger_debug +# define Qntan_Logger_debug(A, ...) do{if(A){(*(A))->debug(A, __VA_ARGS__);}}while(0) +#endif +#ifndef Qntan_Logger_trace +# define Qntan_Logger_trace(A, ...) do{if(A){(*(A))->trace(A, __VA_ARGS__);}}while(0) +#endif +#ifndef Qntan_Logger_isFatalOn +# define Qntan_Logger_isFatalOn(A) ((A) && (*(A))->isFatalOn(A)) +#endif +#ifndef Qntan_Logger_isErrorOn +# define Qntan_Logger_isErrorOn(A) ((A) && (*(A))->isErrorOn(A)) +#endif +#ifndef Qntan_Logger_isWarnOn +# define Qntan_Logger_isWarnOn(A) ((A) && (*(A))->isWarnOn(A)) +#endif +#ifndef Qntan_Logger_isInfoOn +# define Qntan_Logger_isInfoOn(A) ((A) && (*(A))->isInfoOn(A)) +#endif +#ifndef Qntan_Logger_isDebugOn +# define Qntan_Logger_isDebugOn(A) ((A) && (*(A))->isDebugOn(A)) +#endif +#ifndef Qntan_Logger_isTraceOn +# define Qntan_Logger_isTraceOn(A) ((A) && (*(A))->isTraceOn(A)) +#endif + struct Qntan_Logger { /* Logger impls MUST prefer format specifiers that are specified in * POSIX stdio printf family of functions. * Logger impls SHOULD NOT implement format specifiers that could be * confused by standard specifiers specified by stdio printf and * related APIs. + * This API also got inspiration from "http://slf4j.org/". So you + * might find useful documentation there, even slf4j is made for + * Java. */ void (*fatal)( struct Qntan_Logger**, char const*fmt, ...); /**/ @@ -290,6 +330,18 @@ struct Qntan_Logger { /**/ void (*trace)( struct Qntan_Logger**, char const*fmt, ...); /**/ + int (*isFatalOn)( struct Qntan_Logger** ); + /**/ + int (*isErrorOn)( struct Qntan_Logger** ); + /**/ + int (*isWarnOn)( struct Qntan_Logger** ); + /**/ + int (*isInfoOn)( struct Qntan_Logger** ); + /**/ + int (*isDebugOn)( struct Qntan_Logger** ); + /**/ + int (*isTraceOn)( struct Qntan_Logger** ); + /**/ }; |
