summaryrefslogtreecommitdiff
path: root/libghack/include/log.h
blob: e7d0e29e0c6262b574b84a2311413ffeeea24520 (plain)
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
#ifndef LOG_H_INCLUDED
#define LOG_H_INCLUDED

#include <stdio.h>
#include <windows.h>
#ifdef UNICODE
#include <wchar.h>
#endif

extern FILE *log_file;


#ifdef UNICODE
#define dbg(msg, ...) logw_to(TEXT(__FILE__), __LINE__, TEXT(msg), __VA_ARGS__)
#else
#define dbg(msg, ...) log_to(__FILE__, __LINE__, msg, __VA_ARGS__)
#endif

extern BOOL log_init(char *p_fname);

extern void log_to(const char *file, SIZE_T line, const char *msg, ...);

#ifdef UNICODE
extern void logw_to(const char *file, SIZE_T line, char *msg, ...);
#endif

extern void log_flush(void);

extern void log_close(void);

#endif // LOG_H_INCLUDED