[hibernate-dev] Tests asserting warnings get logged
sanne at hibernate.org
Fri Mar 28 08:21:48 EDT 2014
On 28 March 2014 12:15, Hardy Ferentschik <hardy at hibernate.org> wrote:
> On 28 Jan 2014, at 13:03, Sanne Grinovero <sanne at hibernate.org> wrote:
>> I'd then remove Log4J from our test dependencies to primarily rely on
>> assertions only;
> Why would you do that? I would expect whatever solution we come up with to
> just delegate to the underlying logger.
Exactly, which doesn't need to be Log4J but could be our testable surrogate.
>> or for debugging purposes to have it forwards
>> messages to System.out too - probably enabled by some environment
>> option - would be good enough.
> We have the logging system configurable already. Why complicating things.
> All we would be after is a way to verify that a given log message gets called.
> Everything else should behave as before.
How so "complicating things"? I'm just suggesting to throw away a lot
of unnecessary complexity and focus on the stuff that matters: assert
for specific messages, which is something Log4J doesn't provide. So we
don't need it, and I don't need it to be configurable either, as long
as I can have a single switch to potentially help with debugging.
More information about the hibernate-dev