Project

General

Profile

Statistics
| Revision:

root / lab4 / .minix-src / include / ddekit / debug.h @ 14

History | View | Annotate | Download (992 Bytes)

1
#ifndef DDEKIT_DEBUG_H
2
#define DDEKIT_DEBUG_H
3
#include <ddekit/ddekit.h>
4
#include <ddekit/printf.h>
5

    
6
#define DDEBUG_QUIET 0
7
#define DDEBUG_ERR 1
8
#define DDEBUG_WARN 2
9
#define DDEBUG_INFO 3
10
#define DDEBUG_VERBOSE 4
11

    
12
#define DDEBUG_MEM DDEBUG_INFO
13

    
14
#define DDEBUG_MSG_ERR(fmt, ...)
15
#define DDEBUG_MSG_WARN(fmt, ...)
16
#define DDEBUG_MSG_INFO(fmt, ...)
17
#define DDEBUG_MSG_VERBOSE(fmt, ...)
18

    
19
#if DDEBUG >= DDEBUG_ERR
20
#undef DDEBUG_MSG_ERR
21
#define  DDEBUG_MSG_ERR(fmt, ...) ddekit_printf("%s : "fmt"\n", __func__, ##__VA_ARGS__ ) 
22
#endif
23

    
24
#if DDEBUG >= DDEBUG_WARN
25
#undef DDEBUG_MSG_WARN
26
#define  DDEBUG_MSG_WARN(fmt, ...) ddekit_printf("%s: "fmt"\n", __func__, ##__VA_ARGS__ )
27
#endif
28

    
29
#if DDEBUG >= DDEBUG_INFO
30
#undef DDEBUG_MSG_INFO
31
#define  DDEBUG_MSG_INFO(fmt, ...) ddekit_printf("%s: "fmt"\n", __func__, ##__VA_ARGS__ )
32
#endif
33

    
34
#if DDEBUG >= DDEBUG_VERBOSE
35
#undef DDEBUG_MSG_VERBOSE
36
#define  DDEBUG_MSG_VERBOSE(fmt, ...) ddekit_printf("%s: "fmt"\n", __func__, ##__VA_ARGS__ ) 
37
#endif
38

    
39
#endif
40

    
41