Open rbgarga opened 6 years ago
We should use the python syslog
module here, for compatibility on all Linux MacOS, every OS:
import syslog
def main():
syslog.syslog(syslog.LOG_INFO, "Everything is working OK.")
syslog.syslog(syslog.LOG_ERR, "This is logged at the error level")
if __name__ == "__main__":
main()
I recently switched over to mac and ran into this same problem. Maybe my reading of the docs is a bit naive, but from the section on the SysLogHandler
link class, it looks the current offlineimap handler has a hard-coded path to the syslog socket (on Linux) as opposed to being based on a network address/port. The current hard-coded path is for Linux syslog daemons, which I think is why it fails on mac.
My simple PR #623 just put a runtime check into setup_sysloghandler
to set the correct socket path based on the system, but maybe there's a better way to handle this?
Patch applied.
General informations
offlineimap -V
): 7.2.0Configuration file offlineimaprc
Logs, error
Steps to reproduce the error
-u syslog
on macOSmacOS doesn't provide /dev/log. I see a socket under
/var/log/syslog
and maybe this is the same expected by offlinimap in this case.