Remove XendLogging dependency from xswatch
PATCH 1/1 Remove XendLogging dependency from xswatch
Hi,
xstransact and xswatch are well designed python interface that can be used by third party utils rather than only in xend. But the logging approach here binds xswatch to xend and prevent it from being used by other utils.
This patch removes the dependency on XendLogging from xswatch.
regards,
zhigang
Remove XendLogging dependency from xswatch
xstransact and xswatch are well designed python interface that can be used by third party utils rather than only in xend. But the logging approach here binds xswatch to xend and prevent it from being used by other utils.
This patch removes the dependency on XendLogging from xswatch.
tools/python/xen/xend/xenstore/xswatch.py +1 -3
@@ -9,8 +9,6 @@ import errno import threading from xen.xend.xenstore.xsutil import xshandle -from xen.xend.XendLogging import log - class xswatch:
@@ -76,7 +74,7 @@ def watchMain(): else: raise except: - log.exception("read_watch failed") + pass # Ignore this exception -- there's no point throwing it # further on because that will just kill the watcher thread, # which achieves nothing.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 7 lines · Zhigang Wang
Hi,
xstransact and xswatch are well designed python interface that can be used by third party utils rather than only in xend. But the logging approach here binds xswatch to xend and prevent it from being used by other utils.
This patch removes the dependency on XendLogging from xswatch.
Instead of doing
from xen.xend.XendLogging import log
...
log.debug("Blah")
All the code could just use Python's real logging API directly avoiding the Xen specific code which doesn't really add any value here. eg
import logging
logging.debug("Blah")
Dan.
Signature · 4 lines
|: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|