Change in vdsm[ovirt-4.0]: logging: add and use new devel logger
Francesco Romani has posted comments on this change. Change subject: logging: add and use new devel logger .. Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.ovirt.org/64516 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5061e78dde7aceffce9ae90fe5e2c2ad8c00f886 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Francesco RomaniGerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Irit Goihman Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Piotr Kliczewski Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: logging: add and use new devel logger
gerrit-hooks has posted comments on this change. Change subject: logging: add and use new devel logger .. Patch Set 4: * update_tracker: OK * Set MODIFIED::bug 1369822#1369822OK, already on MODIFIED * Set MODIFIED::bug 1369822bug 1377069#1377069OK, already on MODIFIED -- To view, visit https://gerrit.ovirt.org/64516 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5061e78dde7aceffce9ae90fe5e2c2ad8c00f886 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Francesco RomaniGerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Piotr Kliczewski Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: logging: add and use new devel logger
Francesco Romani has submitted this change and it was merged. Change subject: logging: add and use new devel logger .. logging: add and use new devel logger After rhbz#1264149 we learned that way that the warnings module doesn't really fit the needs of Vdsm. This patch adds and make the code use a new logger, 'devel', set by default to ERROR level, to be used for the messages that only the developers should see. To see more 'devel' messages, which can be useful for troubleshooting, edit /etc/vdsm/logger.conf to read like: [logger_devel] level=WARNING This change will be persistent across Vdsm restarts. You can also enable the warnings at runtime, like any other logger, using vdsClient -s 0 setLogLevel devel WARNING The change made using vdsClient will be lost when Vdsm is stopped. Change-Id: I5061e78dde7aceffce9ae90fe5e2c2ad8c00f886 Related-To: https://bugzilla.redhat.com/1364149 Bug-Url: https://bugzilla.redhat.com/1369822 Bug-Url: https://bugzilla.redhat.com/1377069 Backport-To: 4.0 Signed-off-by: Francesco RomaniReviewed-on: https://gerrit.ovirt.org/62209 Reviewed-by: Nir Soffer Continuous-Integration: Jenkins CI Reviewed-by: Piotr Kliczewski Reviewed-by: Simone Tiraboschi Reviewed-on: https://gerrit.ovirt.org/64516 --- M README.logging M lib/api/vdsmapi.py M vdsm/logger.conf.in 3 files changed, 15 insertions(+), 8 deletions(-) Approvals: Piotr Kliczewski: Looks good to me, but someone else must approve Jenkins CI: Passed CI tests Francesco Romani: Verified; Looks good to me, approved -- To view, visit https://gerrit.ovirt.org/64516 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5061e78dde7aceffce9ae90fe5e2c2ad8c00f886 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Francesco Romani Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Piotr Kliczewski Gerrit-Reviewer: gerrit-hooks ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: logging: add and use new devel logger
Piotr Kliczewski has posted comments on this change. Change subject: logging: add and use new devel logger .. Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/64516 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5061e78dde7aceffce9ae90fe5e2c2ad8c00f886 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Francesco RomaniGerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Irit Goihman Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Piotr Kliczewski Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: logging: add and use new devel logger
Francesco Romani has posted comments on this change. Change subject: logging: add and use new devel logger .. Patch Set 3: Verified+1 verified the same way as master, with and without logging enabled -- To view, visit https://gerrit.ovirt.org/64516 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5061e78dde7aceffce9ae90fe5e2c2ad8c00f886 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Francesco RomaniGerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Piotr Kliczewski Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: logging: add and use new devel logger
gerrit-hooks has posted comments on this change. Change subject: logging: add and use new devel logger .. Patch Set 3: * update_tracker: OK * Check Bug-Url::OK * Check Public Bug::#1369822::OK, public bug * Check Public Bug::#1377069::OK, public bug * Check Product::#1369822::OK, Correct product Red Hat Enterprise Virtualization Manager * Check Product::#1377069::OK, Correct classification oVirt * Check TM::#1369822::OK, correct target milestone ovirt-4.0.5 * Check TM::#1377069::OK, correct target milestone ovirt-4.0.5 * Check merged to previous::OK, change not open on any previous branch -- To view, visit https://gerrit.ovirt.org/64516 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5061e78dde7aceffce9ae90fe5e2c2ad8c00f886 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Francesco RomaniGerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Piotr Kliczewski Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: logging: add and use new devel logger
gerrit-hooks has posted comments on this change. Change subject: logging: add and use new devel logger .. Patch Set 2: * update_tracker: OK * Check Bug-Url::OK * Check Public Bug::#1369822::OK, public bug * Check Public Bug::#1377069::OK, public bug * Check Product::#1369822::OK, Correct product Red Hat Enterprise Virtualization Manager * Check Product::#1377069::OK, Correct classification oVirt * Check TM::#1369822::OK, correct target milestone ovirt-4.0.5 * Check TM::#1377069::OK, correct target milestone ovirt-4.0.5 * Check merged to previous::OK, change not open on any previous branch -- To view, visit https://gerrit.ovirt.org/64516 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5061e78dde7aceffce9ae90fe5e2c2ad8c00f886 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Francesco RomaniGerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Piotr Kliczewski Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: logging: add and use new devel logger
gerrit-hooks has posted comments on this change. Change subject: logging: add and use new devel logger .. Patch Set 1: * update_tracker: OK * Check Bug-Url::OK * Check Public Bug::#1369822::OK, public bug * Check Public Bug::#1377069::OK, public bug * Check Product::#1369822::OK, Correct product Red Hat Enterprise Virtualization Manager * Check Product::#1377069::OK, Correct classification oVirt * Check TM::#1369822::OK, correct target milestone ovirt-4.0.5 * Check TM::#1377069::OK, correct target milestone ovirt-4.0.5 * Check merged to previous::OK, change not open on any previous branch -- To view, visit https://gerrit.ovirt.org/64516 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5061e78dde7aceffce9ae90fe5e2c2ad8c00f886 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Francesco RomaniGerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Piotr Kliczewski Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: logging: add and use new devel logger
Hello Piotr Kliczewski, Nir Soffer, I'd like you to do a code review. Please visit https://gerrit.ovirt.org/64516 to review the following change. Change subject: logging: add and use new devel logger .. logging: add and use new devel logger After rhbz#1264149 we learned that way that the warnings module doesn't really fit the needs of Vdsm. This patch adds and make the code use a new logger, 'devel', set by default to ERROR level, to be used for the messages that only the developers should see. To see more 'devel' messages, which can be useful for troubleshooting, edit /etc/vdsm/logger.conf to read like: [logger_devel] level=WARNING This change will be persistent across Vdsm restarts. You can also enable the warnings at runtime, like any other logger, using vdsClient -s 0 setLogLevel devel WARNING The change made using vdsClient will be lost when Vdsm is stopped. Change-Id: I5061e78dde7aceffce9ae90fe5e2c2ad8c00f886 Related-To: https://bugzilla.redhat.com/1364149 Bug-Url: https://bugzilla.redhat.com/1369822 Bug-Url: https://bugzilla.redhat.com/1377069 Backport-To: 4.0 Signed-off-by: Francesco RomaniReviewed-on: https://gerrit.ovirt.org/62209 Reviewed-by: Nir Soffer Continuous-Integration: Jenkins CI Reviewed-by: Piotr Kliczewski Reviewed-by: Simone Tiraboschi --- M README.logging M lib/api/vdsmapi.py M vdsm/logger.conf.in 3 files changed, 15 insertions(+), 9 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/64516/1 diff --git a/README.logging b/README.logging index c6ec567..5d81c9f 100644 --- a/README.logging +++ b/README.logging @@ -52,6 +52,9 @@ 4. silence JSONRPC logs: vdsClient -s 0 setLogLevel WARNING jsonrpc +5. enable the 'devel' logs, which could be useful for developers +vdsClient -s 0 setLogLevel devel WARNING + Notes - diff --git a/lib/api/vdsmapi.py b/lib/api/vdsmapi.py index 81d8070..6ad04f5 100755 --- a/lib/api/vdsmapi.py +++ b/lib/api/vdsmapi.py @@ -23,10 +23,8 @@ import logging import os import six -import warnings import yaml -from vdsm.config import config from vdsm.logUtils import Suppressed from yajsonrpc import JsonRpcInvalidParamsError @@ -46,6 +44,9 @@ '[]': []} +_log_devel = logging.getLogger("devel") + + class SchemaNotFound(Exception): pass @@ -56,10 +57,6 @@ class MethodNotFound(Exception): pass - - -class Inconsistency(Warning): -""" API usage conflicts with the schema """ def find_schema(schema_name='vdsm-api'): @@ -145,8 +142,8 @@ def _report_inconsistency(self, message): if self._strict_mode: raise JsonRpcInvalidParamsError(message) -elif config.getboolean('devel', 'python_warnings_enable'): -warnings.warn(message, Inconsistency) +else: +_log_devel.warning('%s', message) def verify_args(self, class_name, method_name, args): try: diff --git a/vdsm/logger.conf.in b/vdsm/logger.conf.in index b3d603e..4625427 100644 --- a/vdsm/logger.conf.in +++ b/vdsm/logger.conf.in @@ -1,5 +1,5 @@ [loggers] -keys=root,vds,Storage,virt,ovirt_hosted_engine_ha,ovirt_hosted_engine_ha_config,IOProcess,connectivity +keys=root,vds,Storage,virt,ovirt_hosted_engine_ha,ovirt_hosted_engine_ha_config,IOProcess,connectivity,devel [handlers] keys=console,syslog,logfile,connlogfile @@ -54,6 +54,12 @@ qualname=virt propagate=0 +[logger_devel] +level=ERROR +handlers=logfile +qualname=devel +propagate=0 + [handler_syslog] level=WARNING class=handlers.SysLogHandler -- To view, visit https://gerrit.ovirt.org/64516 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5061e78dde7aceffce9ae90fe5e2c2ad8c00f886 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Francesco Romani Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Piotr Kliczewski ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org