Skip to content
  • Hartley McGuire's avatar
    342455e5
    [ruby/logger] Enable subclasses to configure level isolation · 342455e5
    Hartley McGuire authored
    (https://github.com/ruby/logger/pull/103)
    
    `Logger#with_level` was recently added to enable configuring a
    `Logger`'s level for the duration of a block. However, the configured
    level is always tied to the currently running `Fiber`, which is not
    always ideal in applications that mix `Thread`s and `Fiber`s.
    
    For example, Active Support has provided a similar feature
    (`ActiveSupport::Logger#log_at`) which, depending on configuration, can
    be isolated to either `Thread`s or `Fiber`s.
    
    This commit enables subclasses of `Logger` to customize the level
    isolation. Ideally, it will enable replacing most of Active Support's
    `#log_at`, since both methods end up serving the same purpose.
    
    https://github.com/ruby/logger/commit/dae2b832cd
    342455e5
    [ruby/logger] Enable subclasses to configure level isolation
    Hartley McGuire authored
    (https://github.com/ruby/logger/pull/103)
    
    `Logger#with_level` was recently added to enable configuring a
    `Logger`'s level for the duration of a block. However, the configured
    level is always tied to the currently running `Fiber`, which is not
    always ideal in applications that mix `Thread`s and `Fiber`s.
    
    For example, Active Support has provided a similar feature
    (`ActiveSupport::Logger#log_at`) which, depending on configuration, can
    be isolated to either `Thread`s or `Fiber`s.
    
    This commit enables subclasses of `Logger` to customize the level
    isolation. Ideally, it will enable replacing most of Active Support's
    `#log_at`, since both methods end up serving the same purpose.
    
    https://github.com/ruby/logger/commit/dae2b832cd
Loading