Commit 9f8571a7 authored by Rosen Matev's avatar Rosen Matev
Browse files

Reduce python logging verbosity

parent d411b6b3
......@@ -10,14 +10,18 @@
###############################################################################
from __future__ import absolute_import, division, print_function
import logging
from Configurables import (
CallgrindProfile,
DeterministicPrescaler,
DDDBConf,
CondDB,
# FIXME(NN): We shouldn't need to refer to IOV explicitly in our framework
LHCb__DetDesc__ReserveDetDescForEvent as reserveIOV,
LHCb__Tests__FakeEventTimeProducer as DummyEventTime,
)
from Gaudi.Configuration import DEBUG
from Gaudi.Configuration import ConfigurableUser, DEBUG
from GaudiConf import IOHelper
from PRConfig.TestFileDB import test_file_db
......@@ -31,11 +35,30 @@ __all__ = [
'EverythingHandler',
]
log = logging.getLogger(__name__)
def _is_node(arg):
return isinstance(arg, CompositeNode)
class PythonLoggingConf(ConfigurableUser):
"""Takes care of configuring the python logging verbosity."""
# Make sure we're applied before anything else by listing
# configurables in __used_configurables__. This ensures that we can
# modify the python logging level before anything spits out messages.
__used_configurables__ = [
CondDB,
DDDBConf,
]
def __apply_configuration__(self):
import GaudiKernel.ProcessJobOptions
# turn off printing for the rest of the configuration
log.info('Disabling info messages from python logging')
GaudiKernel.ProcessJobOptions.PrintOff()
class EverythingHandler(object):
"""The high level application configurator.
......@@ -100,6 +123,9 @@ class EverythingHandler(object):
if debug:
self._scheduler.OutputLevel = DEBUG
self._hiveDataBroker.OutputLevel = DEBUG
# Instantiate the configurable which will set the python
# logging verbosity at the right time.
PythonLoggingConf()
def find_configurable_alg(self, name):
if not self.configurable_algs:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment