43 state.
log = fopen(
"/dev/null",
"w");
44 log_info(&state, 1,
"Hidden message 1");
45 log_info(&state, 0,
"Displayed message 1");
46 log_warning(&state,
"Warning message during startup");
47 log_error(&state,
"Error message during startup");
50 log_info(&state, 1,
"Running state");
51 log_info(&state, 2,
"Currently running with verbosity %d", state.
verbose);
52 log_warning(&state,
"Warning message while running");
53 log_error(&state,
"Error message while running");
55 log_info(&state, 1,
"Shutting down state");
56 log_warning(&state,
"Warning message during shutdown");
57 log_error(&state,
"Error message during shutdown");
void log_info(const program_state *s, const int level, const char *format,...)
Output formatted information message at a given level.
void log_warning(const program_state *s, const char *format,...)
Output formatted warning message.
void log_error(const program_state *s, const char *format,...)
Output formatted error message.
Program state and logging information.
int verbose
Current log verbosity (console output)
bool started
Indicates startup completed.
bool shutdown
Indicates shutdown begun.