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

Add support for shared context and tagged log entries #10

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

solnic
Copy link
Member

@solnic solnic commented Nov 7, 2022

This adds support for setting arbitrary context data that's shared across all backends while logging and also tagged log entries:

irb(main):002:0> logger = Dry.Logger(:my_app)
=> 
#<Dry::Logger::Dispatcher:0x0000000106ae9b40
...
irb(main):003:0> logger.context[:component] = "test"
=> "test"
irb(main):004:0> logger.info "hello"
hello component="test"

irb(main):005:0> logger.tagged("red") { logger.warn("oops") }
oops component="test",tag="red"

@solnic solnic marked this pull request as ready for review November 7, 2022 20:21
@solnic solnic merged commit 380d3dd into main Nov 7, 2022
@solnic solnic deleted the tagged-logging branch November 7, 2022 20:24
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 this pull request may close these issues.

1 participant