logs.h
Exposes logging functions.
- Author: Edward Jones
- Date: 2021-09-17
fini_logs
Finalise logging.
void fini_logs(void);
init_logs
Initialise logging.
- Param
args
: Parsed command-line arguments
void init_logs(Args* args);
log_debug
Write a debug message to stderr.
- Param
format
: debug message format (printf) - Param
...
: Possible printf arguments
void log_debug(const char* restrict format, ...) __attribute__((format(printf, 1, 2)));
log_err
Write an error stderr.
- Param
format
: Error format (printf) - Param
...
: Possible printf arguments
void log_err(const char* restrict format, ...) __attribute__((cold)) __attribute__((format(printf, 1, 2)));
log_err_at
Write an error stderr referencing a source location.
- Param
loc
: The source location to reference - Param
format
: Error format (printf) - Param
...
: Possible printf arguments
void log_err_at(Location* loc, const char* restrict format, ...) __attribute__((cold))
log_info
Write information to stderr.
- Param
format
: Information format (printf) - Param
...
: Possible printf arguments
void log_info(const char* restrict format, ...) __attribute__((format(printf, 1, 2)));
log_warn
Write a warning to stderr.
- Param
format
: Warning format (printf) - Param
...
: Possible printf arguments
int log_warn(const char* restrict format, ...) __attribute__((format(printf, 1, 2)));
log_warn_at
Write a warning to stderr referencing a source location.
- Param
loc
: The source location to reference - Param
format
: Warning format (printf) - Param
...
: Possible printf arguments
int log_warn_at(Location* loc, const char* restrict format, ...);
vlog_debug
Write a debug message to stderr, using a va_list of format-arguments.
- Param
format
: debug message format (printf) - Param
...
: Possible printf arguments
void vlog_debug(const char* restrict format, va_list va);
vlog_err
Write an error stderr, using a va_list of format-arguments.
- Param
format
: Error format (printf) - Param
...
: Possible printf arguments
void vlog_err(const char* restrict format, va_list va);
vlog_err_at
Write an error stderr referencing a source location, using a va_list of format-arguments.
- Param
loc
: The source location to reference - Param
format
: Error format (printf) - Param
...
: Possible printf arguments
void vlog_err_at(Location* loc, const char* restrict format, va_list va);
vlog_info
Write information to stderr, using a va_list of format-arguments.
- Param
format
: Information format (printf) - Param
...
: Possible printf arguments
void vlog_info(const char* restrict format, va_list va);
vlog_warn
Write a warning to stderr, using a va_list of format-arguments.
- Param
format
: Warning format (printf) - Param
...
: Possible printf arguments
int vlog_warn(const char* restrict format, va_list va);
vlog_warn_at
Write a warning to stderr referencing a source location, using a va_list of format-arguments.
- Param
loc
: The source location to reference - Param
format
: Warning format (printf) - Param
...
: Possible printf arguments
int vlog_warn_at(Location* loc, const char* restrict format, va_list va);