summaryrefslogtreecommitdiff
path: root/src/log.h
blob: bdd7af4ddd219e08c7c6f52de9dfad8ae2559387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef _LOG_H_
#define _LOG_H_

#include "server.h"

/* 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);

#define WP() log_error_write(srv, __FILE__, __LINE__, "");

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, ...);
int log_error_cycle(server *srv);

#endif