Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ruby/logger
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: nevans/logger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: context-api
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 6 commits
  • 4 files changed
  • 2 contributors

Commits on Sep 24, 2025

  1. Configuration menu
    Copy the full SHA
    fd3fe6a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    20fb364 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    be6c5bb View commit details
    Browse the repository at this point in the history
  4. use attribute methods instead of ivars

    Co-authored-by: nicholas a. evans <nick@rubinick.dev>
    HoneyryderChuck and nevans committed Sep 24, 2025
    Configuration menu
    Copy the full SHA
    5912f09 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2025

  1. 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)
    nevans committed Sep 29, 2025
    Configuration menu
    Copy the full SHA
    5a26ed7 View commit details
    Browse the repository at this point in the history
  2. 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.
    nevans committed Sep 29, 2025
    Configuration menu
    Copy the full SHA
    b903e6e View commit details
    Browse the repository at this point in the history
Loading