Repository navigation
Comparing changes
Open a pull request
base repository: ruby/logger
base: master
head repository: nevans/logger
compare: default-context
- 12 commits
- 5 files changed
- 2 contributors
Commits on Sep 24, 2025
-
Configuration menu - View commit details
-
Copy full SHA for fd3fe6a - Browse repository at this point
Copy the full SHA fd3fe6aView commit details -
add support in logger API (only #info for now) to pass context down t…
…o the formatter as kwargs
Configuration menu - View commit details
-
Copy full SHA for 20fb364 - Browse repository at this point
Copy the full SHA 20fb364View commit details -
Configuration menu - View commit details
-
Copy full SHA for be6c5bb - Browse repository at this point
Copy the full SHA be6c5bbView commit details -
use attribute methods instead of ivars
Co-authored-by: nicholas a. evans <nick@rubinick.dev>
Configuration menu - View commit details
-
Copy full SHA for 5912f09 - Browse repository at this point
Copy the full SHA 5912f09View commit details
Commits on Sep 29, 2025
-
Update log context PR with review comments
The biggest change is simplifying to _only_ support hash context. Subclasses may use other context types, or imbue specific hash keys with special behavior. Logger: * Only support hash context in `#merge_context` and `#format_message`. * Add public `#context` method. * Add private `#context_store` method (for misbehaving subclasses). * Add rdoc for new and updated public methods * Add `context` keyword parameter to other level-specific methods * Simplify `#format_message` by delegating to `#merge_context`. * Handle nil `prev_context` in `#merge_context` * Move the `context.dup` from `#merge_context` into `#with_context`, to avoid `context.dup` in `#format_message`. Context is also frozen, so `#context` can be safe without dup. Formatter: * Only support hash context in `#format_context`. * Print context after the message. * Context values are escaped. * Don't use [brackets] around context. * Fix backward compatibility with ruby < 2.7 (`#filter_map`) * Remove trailing whitespace from `#format_context`. * Adds several more methods as extension points: `#format_pair`, `#format_value`, `#join_fields`, and `#format_message_with_context`. Tests: * Update for the changes listed above. * Fix backward compatibility with ruby < 2.7 (kwargs handling)
Configuration menu - View commit details
-
Copy full SHA for 5a26ed7 - Browse repository at this point
Copy the full SHA 5a26ed7View commit details -
Rename context_store to context_overrides
I want each logger instance to have its own default context in addition to the fiber-scoped overrides. With that in mind, I think it's better to name the hash of overrides differently.
Configuration menu - View commit details
-
Copy full SHA for b903e6e - Browse repository at this point
Copy the full SHA b903e6eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d4b0aa - Browse repository at this point
Copy the full SHA 7d4b0aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 95c309c - Browse repository at this point
Copy the full SHA 95c309cView commit details
Commits on Oct 1, 2025
-
Use ObjectSpace::WeakKeyMap for level_override
This allows fiber keys to be GCed and removed from the map. Otherwise, fibers that call `#with_level` create a memory leak if they are killed without running their ensure blocks.
Configuration menu - View commit details
-
Copy full SHA for 4576128 - Browse repository at this point
Copy the full SHA 4576128View commit details -
Clear level overrides in #dup and #clone
Cloning loggers can be used, for example, to create different loggers for different classes/components/subsystems that share the same log_dev and other configuration (possibly a subclass of Logger), but with different verbosity levels, formatters, etc. But, that doesn't work if they share `@level_override`. Rather than use OverrideMap.new, the existing `@level_override` is cloned and cleared, to preserve `@level_override`'s class.
Configuration menu - View commit details
-
Copy full SHA for 1b4e472 - Browse repository at this point
Copy the full SHA 1b4e472View commit details -
Configuration menu - View commit details
-
Copy full SHA for 099aff9 - Browse repository at this point
Copy the full SHA 099aff9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4cc602f - Browse repository at this point
Copy the full SHA 4cc602fView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...default-context