2005-02-20 14:27:00 +00:00
|
|
|
#ifndef _LOG_H_
|
|
|
|
#define _LOG_H_
|
2016-03-19 15:14:35 +00:00
|
|
|
#include "first.h"
|
2005-02-20 14:27:00 +00:00
|
|
|
|
|
|
|
#include "server.h"
|
|
|
|
|
2016-07-18 18:24:39 +00:00
|
|
|
struct timespec; /* declaration */
|
|
|
|
int log_clock_gettime_realtime (struct timespec *ts);
|
|
|
|
|
2015-08-22 16:01:08 +00:00
|
|
|
ssize_t write_all(int fd, const void* buf, size_t count);
|
|
|
|
|
2008-04-29 20:59:39 +00:00
|
|
|
/* Close fd and _try_ to get a /dev/null for it instead.
|
|
|
|
* Returns 0 on success and -1 on failure (fd gets closed in all cases)
|
|
|
|
*/
|
|
|
|
int openDevNull(int fd);
|
|
|
|
|
2009-04-10 10:50:51 +00:00
|
|
|
int open_logfile_or_pipe(server *srv, const char* logfile);
|
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
int log_error_open(server *srv);
|
|
|
|
int log_error_close(server *srv);
|
|
|
|
int log_error_write(server *srv, const char *filename, unsigned int line, const char *fmt, ...);
|
2013-03-25 17:22:32 +00:00
|
|
|
int log_error_write_multiline_buffer(server *srv, const char *filename, unsigned int line, buffer *multiline, const char *fmt, ...);
|
2005-02-20 14:27:00 +00:00
|
|
|
int log_error_cycle(server *srv);
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
#endif
|