27 lines
669 B
C
27 lines
669 B
C
#ifndef ERRORS_H
|
|
#define ERRORS_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdio.h>
|
|
|
|
#include "../config/config.h"
|
|
|
|
/* @brief Initialize the error logging submodule
|
|
* @warning Do not use 'as is', use log_init() instead
|
|
*/
|
|
void errlog_init(bool enabled, int logfile_fd, struct server_config *serv_cfg);
|
|
|
|
/* @brief Retrieves the last error with errno and prints the corresponding
|
|
* error message in the logs and stderr
|
|
*/
|
|
void print_err();
|
|
|
|
/* @brief Prints error logs, just like print_log() but for errors
|
|
*/
|
|
void print_log_err(char *format, ...);
|
|
|
|
/* @brief Returns the string corresponding to the last error that happened
|
|
*/
|
|
char *get_err();
|
|
|
|
#endif // ! ERRORS_H
|