direct-io.hg

changeset 7398:446aa56ca4fe

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>
author emellor@leeni.uk.xensource.com
date Mon Oct 17 13:50:28 2005 +0100 (2005-10-17)
parents fa0faada967b
children 420db20e103c 2b92f50b7692
files tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/XendLogging.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Mon Oct 17 11:36:36 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Mon Oct 17 13:50:28 2005 +0100
     1.3 @@ -24,6 +24,7 @@ Author: Mike Wray <mike.wray@hp.com>
     1.4  
     1.5  """
     1.6  
     1.7 +import logging
     1.8  import string
     1.9  import time
    1.10  import threading
    1.11 @@ -38,7 +39,6 @@ from xen.xend import scheduler
    1.12  from xen.xend import sxp
    1.13  from xen.xend import XendRoot
    1.14  from xen.xend.XendBootloader import bootloader
    1.15 -from xen.xend.XendLogging import log
    1.16  from xen.xend.XendError import XendError, VmError
    1.17  from xen.xend.XendRoot import get_component
    1.18  
    1.19 @@ -102,6 +102,9 @@ ZOMBIE_PREFIX = 'Zombie-'
    1.20  xc = xen.lowlevel.xc.new()
    1.21  xroot = XendRoot.instance()
    1.22  
    1.23 +log = logging.getLogger("xend.XendDomainInfo")
    1.24 +#log.setLevel(logging.TRACE)
    1.25 +
    1.26  
    1.27  ## Configuration entries that we expect to round-trip -- be read from the
    1.28  # config file or xc, written to save-files (i.e. through sxpr), and reused as
    1.29 @@ -802,7 +805,7 @@ class XendDomainInfo:
    1.30          """Update with info from xc.domain_getinfo().
    1.31          """
    1.32  
    1.33 -        log.debug("XendDomainInfo.update(%s) on domain %d", info, self.domid)
    1.34 +        log.trace("XendDomainInfo.update(%s) on domain %d", info, self.domid)
    1.35  
    1.36          if not info:
    1.37              info = dom_get(self.domid)
    1.38 @@ -813,7 +816,7 @@ class XendDomainInfo:
    1.39          self.validateInfo()
    1.40          self.refreshShutdown(info)
    1.41  
    1.42 -        log.debug("XendDomainInfo.update done on domain %d: %s", self.domid,
    1.43 +        log.trace("XendDomainInfo.update done on domain %d: %s", self.domid,
    1.44                    self.info)
    1.45  
    1.46  
     2.1 --- a/tools/python/xen/xend/XendLogging.py	Mon Oct 17 11:36:36 2005 +0100
     2.2 +++ b/tools/python/xen/xend/XendLogging.py	Mon Oct 17 13:50:28 2005 +0100
     2.3 @@ -27,6 +27,14 @@ import logging.handlers
     2.4              'removeLogStderr' ]
     2.5  
     2.6  
     2.7 +if not 'TRACE' in logging.__dict__:
     2.8 +    logging.TRACE = logging.DEBUG - 1
     2.9 +    logging.addLevelName(logging.TRACE,'TRACE')
    2.10 +    def trace(self, *args, **kwargs):
    2.11 +        self.log(logging.TRACE, *args, **kwargs)
    2.12 +    logging.Logger.trace = trace
    2.13 +
    2.14 +
    2.15  log = logging.getLogger("xend")
    2.16  
    2.17