aboutsummaryrefslogtreecommitdiffstats
path: root/src/ckerrlog.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ckerrlog.h')
-rw-r--r--src/ckerrlog.h35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/ckerrlog.h b/src/ckerrlog.h
index d3d7243..2506e99 100644
--- a/src/ckerrlog.h
+++ b/src/ckerrlog.h
@@ -19,19 +19,23 @@
#define CK_STREAMS \
X(err) \
X(log) \
- X(help)
+ X(logv) \
+ X(help)
-void ckerr_add_component(char *txt, ...);
-
-extern void initialize_errlog();
+extern void initialize_errlog(int argc, char* argv[]);
extern void report_errlog();
extern void errlog_set_verbose(int level);
extern void ckerr(char *err, ...);
extern void cklog(char *log, ...);
extern void ckhelp(char *log, ...);
-extern void report_err();
-extern void report_help();
+
+#define X(stream) \
+ extern void ck## stream(char *log, ...); \
+ void ck## stream ##_with_delim(char *d, char *txt, ...); \
+ void report_## stream();
+CK_STREAMS
+#undef X
/**********/
/* Macros */
@@ -41,9 +45,22 @@ extern void report_help();
#define ERRLOG(_COMPONENT) \
static const char COMPONENT[STR_S] = #_COMPONENT
-#define ERR(...) \
- ckerr("Error in [%s]:", COMPONENT); \
- ckerr(__VA_ARGS__); \
+#define ERR(...) \
+ ckerr_with_delim("\n", "Error in [%s]:", COMPONENT); \
+ ckerr(__VA_ARGS__); \
+ cklog_with_delim(" ", "ERROR: [%s]", COMPONENT); \
+ cklog(__VA_ARGS__); \
report_err();
+/* Print help message */
+#define HELP(...) \
+ ckhelp(__VA_ARGS__); \
+ report_help();
+
+/* Log event */
+#define LOG(...) \
+ cklog_with_delim(" ", "[%s]", COMPONENT); \
+ cklog(__VA_ARGS__);
+
+#define LOG_V(...)
#endif /* CKERRLOG_H */