commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30375] - [dbcp] Use commons-logging for debugging instead of System.out.println
Date Wed, 30 Nov 2005 17:20:50 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30375>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30375





------- Additional Comments From bruce@callenish.com  2005-11-30 18:20 -------
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
the patch.

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:

  bash$ animal
  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)
    LogAbandoned: false
    RemoveAbandoned: true
    RemoveAbandonedTimeout: 300
  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.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message