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

Dynamic target for logging #3178

Open
Braqzen opened this issue Dec 28, 2024 · 2 comments
Open

Dynamic target for logging #3178

Braqzen opened this issue Dec 28, 2024 · 2 comments

Comments

@Braqzen
Copy link

Braqzen commented Dec 28, 2024

Feature Request

Motivation

I should be able to do

info!(target: some_variable);

additionally it would be nice to set the target globally so each log doesn't have to pass it in.

Being able to pass in a value enables custom targets in libraries rather than hard coding for each case.

@kaffarell
Copy link
Contributor

Does it have to be target? Why not add a different attribute which can be added to a span?

@Braqzen
Copy link
Author

Braqzen commented Jan 7, 2025

Does it have to be target? Why not add a different attribute which can be added to a span?

It appears that target is the correct way to do it.
Iirc you may also turn the target off when creating a subscriber but then it displays <log leve> trace instead.

It would be nice to have a dynamic <level> TARGET ....

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