--- a/src/server/daemon/log.h Sun Jan 29 09:04:06 2017 +0100 +++ b/src/server/daemon/log.h Sun Jan 29 09:40:04 2017 +0100 @@ -31,6 +31,7 @@ #include "../public/nsapi.h" #include <ucx/string.h> +#include <ucx/utils.h> #include <inttypes.h> @@ -56,6 +57,11 @@ LogFile *log; } AccessLog; +typedef void (*log_writefunc)(void *cookie, char *msg, size_t length); +typedef struct { + log_writefunc write; + void *cookie; +} LogDup; // server logging int init_log_file(LogConfig *cfg); @@ -65,6 +71,8 @@ sstr_t log_get_prefix(int level); +void log_add_logdup(LogDup *dup); +void log_remove_logdup(LogDup *dup); // access logging LogFile* get_access_log_file(sstr_t file);