-
Notifications
You must be signed in to change notification settings - Fork 12
/
log.h
23 lines (19 loc) · 794 Bytes
/
log.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef LOG_H
#define LOG_H
#include <stdio.h>
#include <string.h>
#define LOG_PATH "ur0:data/"
#define LOG_FILE LOG_PATH "vitabright_log.txt"
void log_reset();
void log_write(const char *buffer, size_t length);
#ifdef ENABLE_LOGGING
#define LOG(...) \
do { \
char buffer[256]; \
snprintf(buffer, sizeof(buffer), ##__VA_ARGS__); \
log_write(buffer, strlen(buffer)); \
} while (0)
#else
#define LOG(...)
#endif
#endif