Logging that works on Linux and macos

Hi Folks,

Now that I think about it, I'm not sure I care about macos. I am amazed Rust runs at all on that OS.

I thought I had logging working, until I tried to do a little bit more on macos. Now it turns out that I've only been seeing logs from main(). Nothing from modules.
I've been using stderrlog, when I finally noticed that it wasn't writing anything from modules. I switched to syslog, and now get /no/ output. All logging goes into the bitbucket. I usually log via info!. Last time I checked, INFO < DEBUG
One would think that the following would produce something useful on both OS.

    syslog::init(Facility::LOG_LOCAL0, LevelFilter::Debug, Some("cutename")).unwrap();

one would be wrong. Nothing in journalctl or whatever console/log are supposed to do

I'm going to try log4rs next, as I have some prior experience with log4j.


Actually, I do get the main() output at info! level with syslog. Still nothing from modules, and I have no control over the systemd MESSAGE field, or the facility

facility is now filterable on Linux. Still nothing on macos. Oh well. The question still remains why I don't get module-level logging.

Logging is working as it is due to recent Debian changes. journalctl is still reading syslog on these systems via rsyslog. That is how logging via stderrlog on Debian writes to the journal. Whatever happens on macos is as opaque as Linux.
Thanks for reading.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.