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

Log with target instead of module path by default? #179

Closed
inferiorhumanorgans opened this issue Sep 30, 2020 · 2 comments · Fixed by #209
Closed

Log with target instead of module path by default? #179

inferiorhumanorgans opened this issue Sep 30, 2020 · 2 comments · Fixed by #209

Comments

@inferiorhumanorgans
Copy link

Thelog macro sets the target to the module path by default but only allows users to override the target. By using the target instead of the module path in the default formatter an end user could trivially modify the default format.

Thoughts?

@jplatte
Copy link
Contributor

jplatte commented Dec 1, 2020

I'm not certain I understand the full implications of this change. @KodrAus wdyt?

@KodrAus
Copy link
Collaborator

KodrAus commented Jan 11, 2021

It sounds like it is confusing that we're using the module path instead of the target, especially since they're usually the same.

I'd be happy to change the default format to use the target instead.

xofyarg added a commit to xofyarg/env_logger that referenced this issue May 6, 2021
Target is used in filter, and its value defaults to module_path. To
enable user customize the format, also to reduce confusion, makes
formatter supporting target as well.

This change introduces a boolean builder variable "honor_target". When
set to true(the default), formatter will use target in the record
metadata.

Fix rust-cli#155, rust-cli#179.
xofyarg added a commit to xofyarg/env_logger that referenced this issue May 6, 2021
Target is used in filter, and its value defaults to module_path. To
enable user customize the format, also to reduce confusion, makes
formatter supporting target as well.

This change introduces a boolean builder variable "honor_target". When
set to true(the default), formatter will use target in the record
metadata.

Fix rust-cli#155 and rust-cli#179.
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

Successfully merging a pull request may close this issue.

3 participants