Closed crispywalrus closed 7 years ago
This resolves #47
@@ develop #48 diff @@
==========================================
Files 63 63
Lines 1533 1533
Methods 1408 1401 -7
Messages 0 0
Branches 125 132 +7
==========================================
Hits 998 998
Misses 535 535
Partials 0 0
Powered by Codecov. Last update 562f50a...635b495
@crispywalrus I'm sorry -- but I don't think this is a workable solution. Simply removing the trait from TwitterServer will cause undue pain and is not backwards compatible. It looks like TwitterServer was not intended to allow for the formatting to be overridden as the LogFormat hardcodes a formatting and is not changeable. A better solution would be to make LogFormat understand the Logging trait and implement it's formatting as the defaultFormatter.
@cacoco Ok, so instead of simply leaving the trait and making it non-default this rewrites it to work with com.twitter.logging classes and to meet the documented criteria of being overridable.
That was my bad, the error was actually due to the lack of the type on defaultFormatter
@mosesn add a premain call to load in place
Problem
LogFormat bypasses the util Logging and Formatting objects and directly sets the jul Formatter. This means log messages initial are logged in the LogFormat format rather than the user define Formatter format. This simply removes the trait from default TwitterServer without deleting the trait so that users can add it in later if they want its format.
Solution
Remove LogFormat from the stack of traits TwitterServer extends by default. Leaving the trait so it can be used.
Result
Using an override of the defaultFormatter works after the change.