failures.h revision 2421fd34d51fed6da985c62b5e078d7e96640653
#ifndef FAILURES_H
#define FAILURES_H
struct ip_addr;
/* Default exit status codes that we could use. */
enum fatal_exit_status {
FATAL_DEFAULT = 89
};
enum log_type {
};
#define DEFAULT_FAILURE_STAMP_FORMAT "%b %d %H:%M:%S "
const char *, va_list);
extern const char *failure_log_type_prefixes[];
/* Change failure handlers. */
#ifndef __cplusplus
#else
/* Older g++ doesn't like attributes in parameters */
#endif
/* Send failures to file. */
ATTR_FORMAT(2, 0);
/* Send failures to syslog() */
ATTR_FORMAT(2, 0);
/* Send failures to specified log file instead of stderr. */
/* Send errors to stderr using internal error protocol. */
void i_set_failure_internal(void);
/* If writing to log fails, ignore it instead of existing with
FATAL_LOGWRITE or FATAL_LOGERROR. */
void i_set_failure_ignore_errors(bool ignore);
/* Send informational messages to specified log file. i_set_failure_*()
functions modify the info file too, so call this function after them. */
void i_set_info_file(const char *path);
/* Set the failure prefix. */
void i_set_failure_prefix(const char *prefix);
/* Prefix failures with a timestamp. fmt is in strftime() format. */
void i_set_failure_timestamp_format(const char *fmt);
/* When logging with internal error protocol, update the process's current
IP address. This is mainly used by the master process to log some IP
address if the process crash. */
/* Call the callback before exit()ing. The callback may update the status. */
/* Call the exit callback and exit() */
void failures_deinit(void);
#endif