logger icon indicating copy to clipboard operation
logger copied to clipboard

Clear level overrides in `#dup` and `#clone`

Open nevans opened this issue 2 months ago • 0 comments

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 can break if they share @level_override. Rather than use OverrideMap.new, the existing @level_override is cloned and cleared, to preserve @level_override's class.


This PR is based on #136 to avoid merge conflicts. But it can be updated to be independent of that other PR, if so desired.

nevans avatar Oct 01 '25 17:10 nevans