As personal choice, we tend not to use debuggers […]
we find stepping through a program less productive
than […] adding output statements and self-checking
code at critical places. It takes less
time to decide where to put print statements than to single-step to
the critical section of code, even assuming we know where that
is. More important, debugging statements stay with the program;
debugging sessions are transient.
(Brian W. Kerninghan, Rob Pike: "The Practice of Programming")
Logging für den Betrieb
Most developers implement logging as though they are the primary
consumer of the log files. In fact, administrators and engineers in
operations will spend far more time with these log files than
developers will. (Michael T. Nygard: "Release It!")
Log-Level
log4j
FATAL
ERROR
WARN
INFO
DEBUG
TRACE
java.util.logging
SEVERE
WARNING
INFO
CONFIG
FINE
FINER
FINEST
Betrieb
ERROR
WARN
INFO
Die Meldungen müssen ohne den Source-Code verständlich sein.
Log-Meldungen in diesen Leveln sind ein Applikations-Feature.
INFO
Eine Operation war erfolgreich, das System ist funktionsfähig
Rückmeldung über Betriebs-Konfigurationen (DB-Connect-String)