From 170b7547dac23c2946f8f1a2e915fc686f46bcca Mon Sep 17 00:00:00 2001 From: Krzysztof Jamrog <krzysztof.piotr.jamrog@cern.ch> Date: Sat, 23 Mar 2019 16:31:20 +0100 Subject: [PATCH] Replaced print with logger --- .../python/EmuStepProcessingConfig.py | 19 ++++++++++++------- .../TrigUpgradeTest/share/EmuNewJOTest.py | 7 +++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py index 399ffa16d4c..9c8fda770ba 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py @@ -2,10 +2,15 @@ # Configure the scheduler from AthenaCommon.AlgScheduler import AlgScheduler -from AthenaCommon.Constants import DEBUG +from AthenaCommon.Constants import DEBUG, VERBOSE from AthenaCommon.CFElements import parOR +from AthenaCommon.Logging import logging from L1Decoder.L1DecoderConf import CTPUnpackingEmulationTool, RoIsUnpackingEmulationTool, L1Decoder +log = logging.getLogger('EmuStepProcessingConfig') +log.setLevel(VERBOSE) + + def generateL1DecoderAndChains(): AlgScheduler.ShowControlFlow( True ) AlgScheduler.ShowDataFlow( True ) @@ -145,7 +150,7 @@ def generateL1DecoderAndChains(): if "MU" in s: EnabledMuComboChains.append(s +" : "+ c.name) if "EM" in s: EnabledElComboChains.append(s +" : "+ c.name) - print "enabled Combo chains: ", EnabledMuComboChains,EnabledElComboChains + log.debug("enabled Combo chains: %s, %s", EnabledMuComboChains, EnabledElComboChains) # this is a temporary hack to include new test chains @@ -166,20 +171,20 @@ def generateL1DecoderAndChains(): emUnpacker = RoIsUnpackingEmulationTool("EMRoIsUnpackingTool", OutputLevel=DEBUG, InputFilename="l1emroi.dat", OutputTrigRoIs="L1EMRoIs", Decisions="L1EM" ) emUnpacker.ThresholdToChainMapping = EnabledElChains + EnabledElComboChains emUnpacker.Decisions="L1EM" - print "EMRoIsUnpackingTool enables chians:" - print emUnpacker.ThresholdToChainMapping + log.debug("EMRoIsUnpackingTool enables chians:") + log.debug(emUnpacker.ThresholdToChainMapping) muUnpacker = RoIsUnpackingEmulationTool("MURoIsUnpackingTool", OutputLevel=DEBUG, InputFilename="l1muroi.dat", OutputTrigRoIs="L1MURoIs", Decisions="L1MU" ) muUnpacker.ThresholdToChainMapping = EnabledMuChains + EnabledMuComboChains muUnpacker.Decisions="L1MU" - print "MURoIsUnpackingTool enables chians:" - print muUnpacker.ThresholdToChainMapping + log.debug("MURoIsUnpackingTool enables chians:") + log.debug(muUnpacker.ThresholdToChainMapping) l1Decoder.roiUnpackers = [emUnpacker, muUnpacker] #print l1Decoder L1UnpackingSeq += l1Decoder - print L1UnpackingSeq + log.debug(L1UnpackingSeq) ########################## L1 ################################################# diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJOTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJOTest.py index cf2528a41e5..c63ee0bf86c 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJOTest.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJOTest.py @@ -5,7 +5,8 @@ Configurable.configurableRun3Behavior=1 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags -from AthenaCommon.Constants import INFO, DEBUG +from AthenaCommon.Constants import INFO, DEBUG, VERBOSE +from AthenaCommon.Logging import logging from ByteStreamCnvSvc.ByteStreamConfig import TrigBSReadCfg from TrigUpgradeTest.TriggerHistSvcConfig import TriggerHistSvcConfig from MuonConfig.MuonCablingConfig import RPCCablingConfigCfg, TGCCablingConfigCfg @@ -19,6 +20,8 @@ from RegionSelector.RegSelConfig import regSelCfg from TrigUpgradeTest.InDetConfig import TrigInDetCondConfig from TrigUpgradeTest.EmuStepProcessingConfig import generateL1DecoderAndChains +log = logging.getLogger('EmuNewJOTest') +log.setLevel(VERBOSE) flags.needFlagsCategory("Trigger") flags.Input.isMC = False @@ -92,7 +95,7 @@ acc.getEventAlgo( "TrigSignatureMoniMT").OutputLevel=DEBUG acc.printConfig() fname = "EmuNewJOTest.pkl" -print("Storing config in the config", fname) +log.debug("Storing config in the config %s", fname) with file(fname, "w") as p: acc.store( p, nEvents=4, useBootStrapFile=False, threaded=True ) p.close() -- GitLab