[ATN] Migration to slf4j finished

Hi, patch which removes oVirt logger was just merged. So in all your current and future patches for oVirt engine please use only slf4j as logging framework. Alon already posted some slf4j guidelines [1]. During logging refactoring we also started to quote parameter values in logging messages. Here are current "rules" for quoting: 1. Quote parameter values ONLY using single quote character 2. Quote non number attribute values 3. Don't quote primitive type numbers 4. Don't quote error messages, because they are the last part of message string after ':', so there's no need to quote 5. Don't quote strings which creates sentence of log message, for example log.info("Feature was {}", enabled ? "enabled" : "disabled"); 6. For the rest of cases use common sense :) Please feel free to write any comments to the quote guidelines. For example we may decide to alter "rule" 2. to not quote value which cannot be null or empty. Once agreed we could add those into some engine Java code convention guide :) Thanks Martin Perina [1] http://lists.ovirt.org/pipermail/devel/2014-October/009028.html

----- Original Message -----
From: "Martin Perina" <mperina@redhat.com> To: devel@ovirt.org Sent: Monday, October 27, 2014 4:58:27 PM Subject: [ovirt-devel] [ATN] Migration to slf4j finished
Hi,
patch which removes oVirt logger was just merged. So in all your current and future patches for oVirt engine please use only slf4j as logging framework.
Alon already posted some slf4j guidelines [1].
During logging refactoring we also started to quote parameter values in logging messages. Here are current "rules" for quoting:
1. Quote parameter values ONLY using single quote character
2. Quote non number attribute values
3. Don't quote primitive type numbers
4. Don't quote error messages, because they are the last part of message string after ':', so there's no need to quote
5. Don't quote strings which creates sentence of log message, for example
log.info("Feature was {}", enabled ? "enabled" : "disabled");
6. For the rest of cases use common sense :)
+1 , and I would say that quoting also should be used for descriptive information. For example - "VM 'my-vm' was stopped"
Please feel free to write any comments to the quote guidelines. For example we may decide to alter "rule" 2. to not quote value which cannot be null or empty.
Once agreed we could add those into some engine Java code convention guide :)
+1 on the convention, thank you for thinking about this.
Thanks
Martin Perina
[1] http://lists.ovirt.org/pipermail/devel/2014-October/009028.html _______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
participants (2)
-
Martin Perina
-
Yair Zaslavsky