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

Hiding module path but displaying target #240

Open
ClementNerma opened this issue Oct 19, 2022 · 3 comments
Open

Hiding module path but displaying target #240

ClementNerma opened this issue Oct 19, 2022 · 3 comments

Comments

@ClementNerma
Copy link

Hi!

I'm currently stuck at configuring the logger. By default, if I write the following code:

// module: example
error!("YOH");
error!(target: "a", "YOH");

It will display:

[2022-10-19T11:08:47Z INFO  onix_server] YOH
[2022-10-19T11:08:47Z INFO  a] YOH

What I'd like to see is:

[2022-10-19T11:08:47Z INFO  ] YOH
[2022-10-19T11:08:47Z INFO  a] YOH

Which means not displaying the module the log comes from, but displaying the custom target if any is provided.

How can I achieve that? I use .format_module_path(false) but it seemed to have no effect.

Thanks in advance for your help!

@jplatte
Copy link
Contributor

jplatte commented Oct 19, 2022

I recommend trying another crate like pretty_env_logger since this one is practically not maintained. I'll keep this issue open though, in case somebody else wants to answer (but I don't expect anybody will).

@epage
Copy link
Contributor

epage commented Nov 10, 2022

FYI this is now being passively maintained by WG-CLI.

If someone is willing to write up a proposal on the current behavior and new desired behavior for this, we would be willing to evaluate that before moving on to a PR.

@mistgc
Copy link

mistgc commented Aug 26, 2023

Is there any way to hide the module path?

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

No branches or pull requests

4 participants