[slf4j-dev] [Bug 135] A default baseclass implementation of a delayed toString evaluator should be available in slf4j
bugzilla-daemon at pixie.qos.ch
bugzilla-daemon at pixie.qos.ch
Fri Jun 12 10:56:39 CEST 2009
http://bugzilla.slf4j.org/show_bug.cgi?id=135
Thorbjørn Ravn Andersen <thorbjoern at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
--- Comment #5 from Thorbjørn Ravn Andersen <thorbjoern at gmail.com> 2009-06-12 10:56:38 ---
I believe that this is trivially simple (providing a holder vwith a object
renderer in the toString()) but that by providing the holder class in SLF4J the
best-practice approach to handle this is in intent and action shown by SLF4j
(which also is a trivially simple (or used to be :) ) approach to the "facade
to logging platforms" problem.
In other words, by providing a base class to override in anonymous functions,
slf4j actively promotes best-practices regarding how to render an object as a
string.
Another approach could be an interface containing a render() method which could
be implemented by objects. If an object is tried to be logged AND implements
this interface, then the render()-method is called, otherwise toString() is
called.
Just a suggestion :)
--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the slf4j-dev
mailing list