X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=src%2Flog.h;h=c88b6c8bc4dde2ce3f0ebdcd779a51c4a12b4cb9;hb=6114bb5f252afb1e86682836b82db3e4c48213fe;hp=c633ad935e32c684df2fea8f4ec028b2e3939229;hpb=02410339261f276bc277f7a39ab5bed727932a41;p=libplp.git diff --git a/src/log.h b/src/log.h index c633ad9..c88b6c8 100644 --- a/src/log.h +++ b/src/log.h @@ -8,9 +8,11 @@ #ifndef LOG_H_ #define LOG_H_ -#define log_debug(...) fprintf(stdout, __VA_ARGS__) -#define log_info(...) fprintf(stdout, __VA_ARGS__) -#define log_warning(...) fprintf(stderr, __VA_ARGS__) -#define log_error(...) fprintf(stderr, __VA_ARGS__) +#include + +#define log_debug(a, b...) fprintf(stdout, "[dbg] %s: " a, __FUNCTION__, ## b) +#define log_info(a, b...) fprintf(stdout, "[inf] %s: " a, __FUNCTION__, ## b) +#define log_warning(a, b...) fprintf(stderr, "[wrn] %s: " a, __FUNCTION__, ## b) +#define log_error(a, b...) fprintf(stderr, "[err] %s: " a, __FUNCTION__, ## b) #endif /* LOG_H_ */