mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 12:28:42 +00:00
log: add syslog support
Add support to log using standard syslog, add related option in dhtnode. dhtnode will use syslog by default when starting in daemon mode and no logfile is defined.
This commit is contained in:
1 parent
3aa720fe1f
commit
39a254ce9f
4 files changed
+48
-6
No files matched your search
+3
-1
@@ -370,7 +370,9 @@ main(int argc, char **argv)
|
||||
dht->run(params.port, crt, true, params.network);
|
||||
|
||||
if (params.log) {
|
||||
if (not params.logfile.empty())
|
||||
if (params.syslog or (params.daemonize and params.logfile.empty()))
|
||||
log::enableSyslog(*dht, "dhtnode");
|
||||
else if (not params.logfile.empty())
|
||||
log::enableFileLogging(*dht, params.logfile);
|
||||
else
|
||||
log::enableLogging(*dht);
|
||||
|
||||
Reference in new issue
Block a user