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

Allow Log.with_context to set context #11347

Closed
caspiano opened this issue Oct 22, 2021 · 0 comments · Fixed by #11517
Closed

Allow Log.with_context to set context #11347

caspiano opened this issue Oct 22, 2021 · 0 comments · Fixed by #11517

Comments

@caspiano
Copy link
Contributor

Feature Request

  • Is your feature request related to a problem? Please describe clearly and concisely what is it.

It's pretty common when using logging contexts to do something like the following (it's even in the docs)

::Log.with_context do
  Log.context.set some_data: 12345
  ...
end
  • Describe the feature you would like, optionally illustrated by examples, and how it will solve the above problem.

I think Log.with_context should be able to set the context for the block.

::Log.with_context(some_data: 12345) do
  ...
end
  • Describe considered alternative solutions, and the reasons why you have not proposed them as a solution here.

As stated above.

  • Does it break backward compatibility, if yes then what's the migration path?

Nope

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

Successfully merging a pull request may close this issue.

1 participant