Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trivial: the systemd example misuses RUST_LOG_STYLE #286

Open
iustin opened this issue Nov 14, 2023 · 1 comment
Open

Trivial: the systemd example misuses RUST_LOG_STYLE #286

iustin opened this issue Nov 14, 2023 · 1 comment

Comments

@iustin
Copy link

iustin commented Nov 14, 2023

I might be wrong, but the systemd example (added in #157) overloads RUST_LOG_STYLE. Since that is parsed internally by env_logger, I think the example is suboptimal; it would be better to control the systemd-vs-non-systemd and style separately, as long as systemd is not directly supported (which would be best, actually, as a new WriteStyle).

I might misunderstand the way the WriteStyle is supposed to work though, not sure.

@Gunni
Copy link

Gunni commented Jan 12, 2024

Also, the example given has this error in it

error[E0599]: cannot write into `&mut env_logger::fmt::Formatter`
  --> src/main.rs:26:5
   |
25 | /             writeln!(
26 | |                 buf,
   | |                 ^^^
27 | |                 "<{}>{}: {}",
28 | |                 match record.level() {
...  |
36 | |                 record.args()
37 | |             )
   | |_____________- method not found in `&mut Formatter`
   |
note: must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method
  --> src/main.rs:26:5
   |
26 |                 buf,
   |                 ^^^
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
   |
1  + use std::io::Write;
   |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants