Added a TRACE log level, for those versions of Python that do not have it, and

moved XendDomainInfo.update's debugging onto that level, as it has become
overly verbose.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2005-10-17 13:50:28 +01:00
1 parent 981d9b117d
commit 37964af428
2 files changed
+14 -3

No files matched your search

+6 -3
View File
@@ -24,6 +24,7 @@ Author: Mike Wray <mike.wray@hp.com>
"""
import logging
import string
import time
import threading
@@ -38,7 +39,6 @@ from xen.xend import scheduler
from xen.xend import sxp
from xen.xend import XendRoot
from xen.xend.XendBootloader import bootloader
from xen.xend.XendLogging import log
from xen.xend.XendError import XendError, VmError
from xen.xend.XendRoot import get_component
@@ -102,6 +102,9 @@ ZOMBIE_PREFIX = 'Zombie-'
xc = xen.lowlevel.xc.new()
xroot = XendRoot.instance()
log = logging.getLogger("xend.XendDomainInfo")
#log.setLevel(logging.TRACE)
## Configuration entries that we expect to round-trip -- be read from the
# config file or xc, written to save-files (i.e. through sxpr), and reused as
@@ -802,7 +805,7 @@ class XendDomainInfo:
"""Update with info from xc.domain_getinfo().
"""
log.debug("XendDomainInfo.update(%s) on domain %d", info, self.domid)
log.trace("XendDomainInfo.update(%s) on domain %d", info, self.domid)
if not info:
info = dom_get(self.domid)
@@ -813,7 +816,7 @@ class XendDomainInfo:
self.validateInfo()
self.refreshShutdown(info)
log.debug("XendDomainInfo.update done on domain %d: %s", self.domid,
log.trace("XendDomainInfo.update done on domain %d: %s", self.domid,
self.info)
+8
View File
@@ -27,6 +27,14 @@ __all__ = [ 'log', 'init', 'getLogFilename', 'addLogStderr',
'removeLogStderr' ]
if not 'TRACE' in logging.__dict__:
logging.TRACE = logging.DEBUG - 1
logging.addLevelName(logging.TRACE,'TRACE')
def trace(self, *args, **kwargs):
self.log(logging.TRACE, *args, **kwargs)
logging.Logger.trace = trace
log = logging.getLogger("xend")
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.