diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2024-05-22 13:00:41 -0400 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2024-05-22 13:00:41 -0400 |
commit | ace65b453151845bc361f21f3e5b651c35f9f126 (patch) | |
tree | 262ebd29b0ca1d8584f0b6f1efa7a00d9f4f3e43 /include/print.h | |
parent | f004c1ade8d617a82cea2fe249434cccb47a2358 (diff) | |
download | jove-kernel-ace65b453151845bc361f21f3e5b651c35f9f126.tar.gz jove-kernel-ace65b453151845bc361f21f3e5b651c35f9f126.tar.bz2 jove-kernel-ace65b453151845bc361f21f3e5b651c35f9f126.zip |
Diffstat (limited to 'include/print.h')
-rw-r--r-- | include/print.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/print.h b/include/print.h new file mode 100644 index 0000000..38a1dbc --- /dev/null +++ b/include/print.h @@ -0,0 +1,25 @@ +#ifndef _JOVE_PRINT_H +#define _JOVE_PRINT_H 1 + +#include <stdarg.h> + +enum { + PRINT_DEBUG = 0, + PRINT_LOG, + PRINT_WARN, + PRINT_ERROR +}; + +#define PRINT_BUFFERW 512 + +void prawf(const char *fmt, ...); + +void _plogvf(const char *file, const char *func, int line, int lvl, const char *fmt, va_list ap); +void _plogf(const char *file, const char *func, int line, int lvl, const char *fmt, ...); + +#define kdbgf(...) _plogf(__FILE__, __FUNCTION__, __LINE__, PRINT_DEBUG, __VA_ARGS__) +#define klogf(...) _plogf(__FILE__, __FUNCTION__, __LINE__, PRINT_LOG , __VA_ARGS__) +#define kwarnf(...) _plogf(__FILE__, __FUNCTION__, __LINE__, PRINT_WARN, __VA_ARGS__) +#define kerrf(...) _plogf(__FILE__, __FUNCTION__, __LINE__, PRINT_ERROR, __VA_ARGS__) + +#endif |