DPDK / grout

grout # a graph router based on DPDK
BSD 3-Clause "New" or "Revised" License
10 stars 5 forks source link

main: restrict logging to syslog when running under systemd #63

Closed rjarry closed 2 months ago

rjarry commented 2 months ago

By default, DPDK log functions print both to stderr and syslog. This is not only unnecessary but also when running as a systemd service, it produces duplicated log lines.

When JOURNAL_STREAM is set in the environment, it indicates that grout has been started by systemd and its stderr is connected to the journal. If that is the case, log using syslog. Otherwise print on stderr prefixing the message with the textual value of the log level.