-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlogs.h
51 lines (42 loc) · 1.07 KB
/
logs.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef __ZH_LOG_H__
#define __ZH_LOG_H__ 1
#include <stdio.h>
#define STR_BUFFER 16*1024
#define FORMULAR_LEFT "\n\\begin{align*}"
#define FORMULAR_RIGHT "\\end{align*}\n"
#define TEX 1
#if TEX
#define LOG_DEBUG 0
#define LOG_TEX 1
#else
#define LOG_DEBUG 1
#define LOG_TEX 0
#endif
#define LOG_NOLOG 0
#define ZHDEBUG LOG_TEX
extern int log_count ;
#define Output(fmt, args...) do{printf(fmt, ##args);}while(0)
#if LOG_DEBUG
#define MDEBUGC(fmt, args...) printf(fmt , ##args)
#define MDEBUG(fmt, args...) do{ \
printf("debug: %s- %s - %d:"fmt "\n", \
__FILE__, __FUNCTION__, __LINE__, ##args); \
log_count ++; \
}while(0)
#define MDEBUGP() MDEBUG("")
#else
#define MDEBUGC(fmt, args...) do{}while(0)
#define MDEBUG(fmt, args...) do{ }while(0)
#define MDEBUGP() do{}while(0)
#endif
extern FILE * tex_log;
#if LOG_TEX
#define TEXDEBUG(fmt, args...) do{printf(fmt, ##args); \
if(tex_log){fprintf(tex_log, fmt, ##args); fflush(tex_log);} \
}while(0)
#else
#define TEXDEBUG(fmt, args...) do{}while(0)
#endif
//#endif
void check_tex_log();
#endif