[Engine-devel] [backend] logger declarations
Laszlo Hornyak
lhornyak at redhat.com
Wed Mar 7 10:15:27 UTC 2012
Hi,
In general loggers are recommended to be private static final, also have the correct class. (e.g. commons logging standards from PMD http://pmd.sourceforge.net/rules/logging-jakarta-commons.html)
In oVirt backend, very often the logger is just package protected, which allows classes in the same package to use it. Actually the classes that really use it are usualy subclasses, but what I believe is misleading in this case is that when reading a log, you will see that e.g. org.foo.Bar logged 'X', and you look into the sourcecode of org.foo.Bar and you do not see any code that would ever log that message, you will have to look for that message in all of it's subclasses and this will make debugging harder especially if the number of subclasses is high.
I am trying to maintain a coding standard here, please feel free to edit:
http://www.ovirt.org/wiki/Backend_Coding_Standards
Thank you,
Laszlo
More information about the Engine-devel
mailing list