mirrord icon indicating copy to clipboard operation
mirrord copied to clipboard

Alternative log level env var for `mirrord-layer`

Open tamasfe opened this issue 2 years ago • 3 comments

Currently it's not possible to silence logs from mirrord-layer when developing a rust application as it uses the RUST_LOG env variable.

Something like MIRRORD_RUST_LOG could be introduced that overrides RUST_LOG if present.

Alternatively logging to file could be preferred instead of silencing, as these messages are still important, but should not be mixed with the executed app's stderr or stdout.

tamasfe avatar Sep 11 '22 17:09 tamasfe

AFAIK you can use RUST_LOG=mirrord=warning then mirrord will print only warnings/errors?

aviramha avatar Sep 12 '22 06:09 aviramha

After some thinking, the current behaviour feels wrong but I don't have alternative suggestions yet. RUST_LOG=info,mirrord=error or similar could work, but for some reason I think the logs should be separate. I think additional support for logging to a file instead of stderr should be enough.

tamasfe avatar Sep 14 '22 11:09 tamasfe

I thought about it as well - I came to the idea of having a -v,vv,vvv,vvvv,vvvvv flags that will enable the logs as most users aren't aware of rust logging facility, maybe as part of it we can separate it from using RUST_LOG

aviramha avatar Sep 14 '22 13:09 aviramha