Skip to content

Commit

Permalink
lower the level of the Process channel to info if a logFrequency is set
Browse files Browse the repository at this point in the history
this avoids tying together the event-status frequency from the overall
terminal log level
  • Loading branch information
tomeichlersmith committed Sep 17, 2024
1 parent 7a8b3e2 commit a4f0592
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Framework/python/ldmxcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,6 @@ def __init__(self, passName):
self.skimRules=[]
self.logFrequency=-1
self.logger = Logger()
self.termLogLevel=2 #warnings and above
self.fileLogLevel=0 #print all messages
self.logFileName='' #won't setup log file
self.compressionSetting=9
self.histogramFile=''
self.conditionsGlobalTag='Default'
Expand All @@ -604,6 +601,15 @@ def __setattr__(self, key, val):
if key in logger_remap:
setattr(self.logger, logger_remap[key], val)
return
elif key == 'logFrequency' and val > 0:
# make sure the Process channel is lowered to info
# later log rules override earlier ones so we put this
# at the front of the list so the user could have overwritten
# this if need be
# 'Process' needs to match the name given in enableLogging
# in include/Framework/Process.h
self.logger.logRules.insert(0, _LogRule('Process', level=1))
# fall through to set the key=val

super().__setattr__(key, val)

Expand Down

0 comments on commit a4f0592

Please sign in to comment.