54 if (spec == NULL || spec[0] ==
'\0')
60 while (*p ==
',' || isspace((
unsigned char)*p))
67 while (*end !=
'\0' && *end !=
',')
71 const char *token_end = end;
72 while (token_end > p && isspace((
unsigned char)*(token_end - 1)))
76 size_t len = (size_t)(token_end - p);
77 if (len >=
sizeof(tok))
78 len =
sizeof(tok) - 1;
83 if (strcmp(tok,
"all") == 0)
85 else if (strcmp(tok,
"none") == 0)
87 else if (strcmp(tok,
"err") == 0)
89 else if (strcmp(tok,
"debug") == 0)
91 else if (strcmp(tok,
"regs") == 0)
93 else if (strcmp(tok,
"states") == 0)
95 else if (strcmp(tok,
"conds") == 0)
97 else if (strcmp(tok,
"regs_v") == 0)
99 else if (strcmp(tok,
"future") == 0)
101 else if (strcmp(tok,
"cycle") == 0)
103 else if (strcmp(tok,
"console") == 0)
105 else if (strcmp(tok,
"peri") == 0)
107 else if (strcmp(tok,
"reader") == 0)
109 else if (strcmp(tok,
"cmds") == 0)
113 ge_log(
LOG_ERR,
"ge_log_set_active_types_from_spec: unknown category '%s'\n", tok);
124 static char line[0x1000];
130 va_start (args, format);
131 vsnprintf(line,
sizeof(line), format, args);
void ge_log_set_active_types_from_spec(const char *spec)
Set active log types from a comma-separated name specification.
static ge_log_type active_log_types
void ge_log_set_active_types(ge_log_type types)
Set active log types.
void ge_log(ge_log_type type, const char *format,...)
Log message.
uint8_t ge_log_enabled(ge_log_type type)
Check if a log type is enabled.
static const char * log_type_name(ge_log_type type)
@ LOG_REGS_V
Register trace per pulse.
@ LOG_ERR
Emulator unrecoverable condition.
@ LOG_FUTURE
Future state network debug.
@ LOG_REGS
Register trace per cycle.
@ LOG_CONSOLE
Console interactions.
@ LOG_CONDS
MSL conditions trace.
@ LOG_CYCLE
Cycle attribution debug.
@ LOG_CMDS
MSL commands trace.
@ LOG_PERI
Peripherals IO.
@ LOG_DEBUG
General detailed debug information.
@ LOG_READER
Integrated Reader.