def checkMessageLoggerSvc(cfgInstance): """ _checkMessageLogger_ Check that the message logger is active and provides the default job report and event logger settings for production """ svcs = cfgInstance.services # // # // Check Job report service will write the expected #// FrameworkJobReport.xml file if not svcs.has_key('MessageLogger'): cfgInstance.add_(CfgModules.Service("MessageLogger")) messageLogger = cfgInstance.services['MessageLogger'] if "fwkJobReports" not in messageLogger.parameterNames_(): messageLogger.fwkJobReports = CfgTypes.untracked(CfgTypes.vstring()) if "FrameworkJobReport" not in messageLogger.fwkJobReports: messageLogger.fwkJobReports.append("FrameworkJobReport") if "FrameworkJobReport" not in messageLogger.parameterNames_(): messageLogger.FrameworkJobReport = CfgTypes.untracked(CfgTypes.PSet()) messageLogger.FrameworkJobReport.default = CfgTypes.untracked( CfgTypes.PSet(limit=CfgTypes.untracked(CfgTypes.int32(0)))) messageLogger.FrameworkJobReport.FwkJob = CfgTypes.untracked( CfgTypes.PSet(limit=CfgTypes.untracked(CfgTypes.int32(10000000)))) # // # // Install the per event output #// if "destinations" not in messageLogger.parameterNames_(): messageLogger.destinations = CfgTypes.untracked(CfgTypes.vstring()) if "EventLogger" not in messageLogger.destinations: messageLogger.destinations.append("EventLogger") if "EventLogger" not in messageLogger.parameterNames_(): messageLogger.EventLogger = CfgTypes.untracked(CfgTypes.PSet()) messageLogger.EventLogger.default = CfgTypes.untracked( CfgTypes.PSet(limit=CfgTypes.untracked(CfgTypes.int32(0)))) messageLogger.FrameworkJobReport.FwkReport = CfgTypes.untracked( CfgTypes.PSet(limit=CfgTypes.untracked(CfgTypes.int32(10000000)), reportEvery=CfgTypes.untracked( CfgTypes.int32(10000000)))) return
def setTFileAdaptorConfig(self, config): """ Give the TFileAdaptor the provided config options """ adaptor = self.data.services.get('AdaptorConfig') if adaptor is None: self.data.add_(CfgModules.Service('AdaptorConfig')) for option in config: value = str(config[option]) # so far only support boolean & string options if option in ('enable', 'stats'): thisType = CfgTypes.bool._valueFromString else: thisType = CfgTypes.string setattr(self.data.services['AdaptorConfig'], option, CfgTypes.untracked(thisType(value)))