aboutsummaryrefslogtreecommitdiff
path: root/src/log_colored.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-04-05 17:53:27 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-04-07 00:03:28 +0200
commitebabaa69c0a3ba992895c7a66729e81e0923d5f1 (patch)
tree39b4a5b90a4f51c98486e8a00898e983b8878a12 /src/log_colored.h
Initial commit.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/log_colored.h')
-rw-r--r--src/log_colored.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/log_colored.h b/src/log_colored.h
new file mode 100644
index 0000000..c7c0014
--- /dev/null
+++ b/src/log_colored.h
@@ -0,0 +1,25 @@
+#ifndef POTD_LOG_COLORED
+#define POTD_LOG_COLORED 1
+
+#include "log.h"
+
+/* ANSI terminal color codes */
+#define RESET "\x1B[0m"
+#define GRN "\x1B[32;1m"
+#define YEL "\x1B[33;1m"
+#define RED "\x1B[31;1;5m"
+/* LOG_SET_FUNCS comfort */
+#define LOG_COLORED_FUNCS log_open_colored, log_close_colored, \
+ log_fmt_colored, log_fmtex_colored
+
+
+int log_open_colored(void);
+
+void log_close_colored(void);
+
+void log_fmt_colored(log_priority prio, const char *fmt, ...);
+
+void log_fmtex_colored(log_priority prio, const char *srcfile,
+ size_t line, const char *fmt, ...);
+
+#endif