-
Notifications
You must be signed in to change notification settings - Fork 2
/
log.h
59 lines (52 loc) · 1.56 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef LOG_H
#define LOG_H
#include <stdint.h>
typedef int ge_log_type;
/**
* Log types from the emulator.
*
* Every log message from the emulator has associated a log type
* such it can be filtered during execution to aid different kinds
* of debugging.
*
* Log types can be combined by OR.
*/
enum ge_log_types {
LOG_ERR = 0x001, ///< Emulator unrecoverable condition
LOG_DEBUG = 0x002, ///< General detailed debug information
LOG_REGS = 0x004, ///< Register trace per cycle
LOG_STATES = 0x008, ///< State trace
LOG_CONDS = 0x010, ///< MSL conditions trace
LOG_REGS_V = 0x020, ///< Register trace per pulse
LOG_FUTURE = 0x040, ///< Future state network debug
LOG_CYCLE = 0x080, ///< Cycle attribution debug
LOG_CONSOLE = 0x100, ///< Console interactions
LOG_PERI = 0x200, ///< Peripherals IO
LOG_READER = 0x400, ///< Integrated Reader
LOG_CMDS = 0x800, ///< MSL commands trace
};
/**
* Set active log types
*
* Specifies which set of logging messages should be displayed.
*
* @param types A set of log types
*/
void ge_log_set_active_types(ge_log_type types);
/**
* Log message
*
* Specifies which set of logging messages should be displayed.
*
* @param type The type of the message
* @param format The printf-style format for the log message
*/
void ge_log(ge_log_type type, const char *format, ...);
/**
* Check if a log type is enabled
*
* @param type The type to check
* @returns true if the logtype mask is enabled
*/
uint8_t ge_log_enabled(ge_log_type type);
#endif /* LOG_H */