本文整理汇总了Python中Acspy.Common.Log.isFlushRunning方法的典型用法代码示例。如果您正苦于以下问题:Python Log.isFlushRunning方法的具体用法?Python Log.isFlushRunning怎么用?Python Log.isFlushRunning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acspy.Common.Log
的用法示例。
在下文中一共展示了Log.isFlushRunning方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testCreation
# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import isFlushRunning [as 别名]
def testCreation(self):
"""PeriodicFlushCheck is correct and consistent after import."""
if not Log.isFlushRunning():
self.assertEqual(True, Log.FLUSHTHREAD is None)
self.assertEqual(True, Log.SCHEDULER is None)
self.assertEqual(True, Log.NEXTEVENT is None)
self.assertEqual(True, Log.INTERVAL is None)
示例2: refresh_logging_config
# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import isFlushRunning [as 别名]
def refresh_logging_config(self):
'''
Reset the logging configuration to the original CDB settings.
Returns: Nothing
Raises: Nothing
'''
# Default values from the XML Schema
lcfg = LoggingConfig_xsd.LoggingConfig()
centrallevel = lcfg.minLogLevel
locallevel = lcfg.minLogLevelLocal
cap = lcfg.maxLogQueueSize
batch = lcfg.dispatchPacketSize
displevel = lcfg.immediateDispatchLevel
flush = lcfg.flushPeriodSeconds
# Retrieve the CDB information
try:
logconfig = self.cdbAccess.getElement("MACI/Containers/" + self.name + "/LoggingConfig", "LoggingConfig")
try:
centrallevel = int(logconfig[0]['minLogLevel'])
except:
# Default value used because CDB has no setting for this attribute
pass
try:
locallevel = int(logconfig[0]['minLogLevelLocal'])
except:
# Default value used because CDB has no setting for this attribute
pass
try:
cap = int(logconfig[0]['maxLogQueueSize'])
except:
# Default value used because CDB has no setting for this attribute
pass
try:
batch = int(logconfig[0]['dispatchPacketSize'])
except:
# Default value used because CDB has no setting for this attribute
pass
try:
displevel = int(logconfig[0]['immediateDispatchLevel'])
except:
# Default value used because CDB has no setting for this attribute
pass
try:
flush = int(logconfig[0]['flushPeriodSeconds'])
except:
# Default value used because CDB has no setting for this attribute
pass
# Refresh all named loggers from the CDB as well.
for log in self.get_logger_names():
self.configureComponentLogger(log)
except:
# No logging configuration given in the CDB so defaults are used.
pass
# Environment variable takes precedence over the CDB value
if 'ACS_LOG_CENTRAL' in environ:
centrallevel = int(environ['ACS_LOG_CENTRAL'])
if 'ACS_LOG_STDOUT' in environ:
locallevel = int(environ['ACS_LOG_STDOUT'])
Log.setDefaultLevels(maci.LoggingConfigurable.LogLevels(False, centrallevel, locallevel))
Log.setCapacity(cap)
Log.setBatchSize(batch)
Log.setImmediateDispatchLevel(displevel)
# No need to create another flush thread when one already exists.
if Log.isFlushRunning():
Log.setFlushInterval(flush)
else:
Log.startPeriodicFlush(flush)