Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
Description
The curent org.slf4j.helpers.MessageFormatter is a bit restrictive in its usability.
I ended up writing my own (starting from the slf4j formatter) to address its shortcomings:
https://github.com/zolyfarkas/spf4j/blob/master/spf4j-core/src/main/java/org/spf4j/base/Slf4jMessageFormatter.java
My implementation basically does:
1) Allow to format to a provided destination (Appendable) allowing you to reduce the amount of garbage generated...
2) Lets you know which arguments have been used in the message allowing you to implement extra logic to handle the unused ones
3) Lets you plug custom formatters for argument types. (you can get better performance and more flexibility)
4) Processing arguments that are arrays is sligtly faster than the stock slf4j formatter.
would there be any interest in improving the slf4j formatter?