Commit 88cd173
Expose the logdev
The motivation here is to fix a Rails issue caused by the way
ActiveSupport extends the ruby Logger to add broadcasting of messages to
multiple destinations. [1] I believe the problem could be much more
elegantly solved if Logger exposed the underlying LogDevice. Going by
repo history, the existence of this object hasn't changed since 2003, so
I think it's stable enough to expose.
In addition to letting you read the logdev, this also lets you pass a
logdev in. To implement broadcasting, we could now define a LogDevice
subclass that delegates its 3 methods to the LogDevices of a list of
underlying loggers, and simply create a new logger with this device.
[1]: https://github.com/rails/rails/blob/ba19dbc49956a73f417abd68c7a5f33e302eacd3/activesupport/lib/active_support/logger.rb#L231 parent f80a18e commit 88cd173
2 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| 548 | + | |
548 | 549 | | |
549 | 550 | | |
550 | 551 | | |
| |||
603 | 604 | | |
604 | 605 | | |
605 | 606 | | |
606 | | - | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
607 | 614 | | |
608 | 615 | | |
609 | 616 | | |
| |||
612 | 619 | | |
613 | 620 | | |
614 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
615 | 628 | | |
616 | 629 | | |
617 | 630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
180 | 190 | | |
181 | 191 | | |
182 | 192 | | |
| |||
0 commit comments