log: set syslog facility to LOG_DAEMON when run in server mode

This commit is contained in:
Daniel Eklöf 2019-11-20 19:43:31 +01:00
parent 4f4ee5b39d
commit 55a23a5b29
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 17 additions and 5 deletions

4
log.h
View file

@ -1,7 +1,11 @@
#pragma once
enum log_facility { LOG_FACILITY_USER, LOG_FACILITY_DAEMON };
enum log_class { LOG_CLASS_ERROR, LOG_CLASS_WARNING, LOG_CLASS_INFO, LOG_CLASS_DEBUG };
void log_init(enum log_facility syslog_facility);
void log_deinit(void);
void log_msg(enum log_class log_class, const char *module,
const char *file, int lineno,
const char *fmt, ...) __attribute__((format (printf, 5, 6)));