summaryrefslogtreecommitdiffstats
path: root/include/print.h
blob: 38a1dbcefd3d766080dba615f89dbb57e4b57b5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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