I'd like to disagree with the logic in the rejection of this patch, and I hope I
can pursuade you to change your mind.
Either DBCP should log information or it shouldn't. If it should, then it should
be using a logging package to provide that behaviour rather than trying to do
the job poorly itself. If DBCP should not log information, then the System.out
and System.err lines should be removed altogether.
The commons-logging package is extremely lightweight, and is a good choice for a
dependency in a library like DBCP that is itself fairly low level. Think of it
as the set of classes to do reflection that are suggested in the rejection of
Why this matters is that libraries putting anything on stdout or stderr is an
Antipattern. It is a side effect that the user of the library can't control. It
is especially incomprehensible in text-mode programs. Consider this dialog:
GUESS WHAT KIND OF ANIMAL I AM
Pick an animal for you to be. I'll ask you a series of questions.
Answer YES or NO to each one, and I'll guess what kind you are.
AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@113f501)
Are you a mammal?
If you absolutely must keep the output, and you absolutely refuse to send it to
a logging package where it belongs, at least give a configuration option to
suppress the output to stdout and stderr, please.