-
Notifications
You must be signed in to change notification settings - Fork 4
/
log.h
34 lines (29 loc) · 805 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
24
25
26
27
28
29
30
31
32
33
34
#ifndef LOG_H
#define LOG_H
// Log sources (should be numbered sequentially from 0)
// If you change the order log_channel_verbose_level in log.c needs updating too
enum log_source {
LOG_SRC_UART = 0,
LOG_SRC_CSR,
LOG_SRC_MBUS,
LOG_SRC_MAPPER,
LOG_SRC_SCSI,
LOG_SRC_RAMROM,
LOG_SRC_RTC,
LOG_SRC_EMU,
LOG_SRC_STRACE,
LOG_SRC_MAX //end sentinel, leave at end of enum
};
// Emulator log levels (higher is more verbose)
enum log_level {
LOG_ERR = 0,
LOG_WARNING,
LOG_NOTICE,
LOG_INFO,
LOG_DEBUG,
LOG_LVL_MAX //end sentinel, leave at end of enum
};
void log_set_level(enum log_source source, enum log_level msg_level);
int log_printf(enum log_source source, enum log_level msg_level, const char *format, ...);
int log_level_active(enum log_source source, enum log_level msg_level);
#endif