本文整理汇总了Python中logger.ServiceMonitorLogger.debug方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceMonitorLogger.debug方法的具体用法?Python ServiceMonitorLogger.debug怎么用?Python ServiceMonitorLogger.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logger.ServiceMonitorLogger
的用法示例。
在下文中一共展示了ServiceMonitorLogger.debug方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from logger import ServiceMonitorLogger [as 别名]
# 或者: from logger.ServiceMonitorLogger import debug [as 别名]
def main(args_str=None):
global _zookeeper_client
if not args_str:
args_str = ' '.join(sys.argv[1:])
args = parse_args(args_str)
if args.cluster_id:
client_pfx = args.cluster_id + '-'
zk_path_pfx = args.cluster_id + '/'
else:
client_pfx = ''
zk_path_pfx = ''
# randomize collector list
args.random_collectors = args.collectors
if args.collectors:
args.random_collectors = random.sample(args.collectors,
len(args.collectors))
# Initialize logger without introspect thread
sm_logger = ServiceMonitorLogger(args, http_server_port=-1)
# Initialize AMQP handler then close it to be sure remain queue of a
# precedent run is cleaned
rabbitmq_cfg = get_rabbitmq_cfg(args)
try:
vnc_amqp = VncAmqpHandle(sm_logger._sandesh, sm_logger, DBBaseSM,
REACTION_MAP, 'svc_monitor', rabbitmq_cfg,
args.trace_file)
vnc_amqp.establish()
vnc_amqp.close()
except Exception:
pass
finally:
sm_logger.debug("Removed remained AMQP queue")
# Waiting to be elected as master node
_zookeeper_client = ZookeeperClient(
client_pfx+"svc-monitor", args.zk_server_ip)
sm_logger.notice("Waiting to be elected as master...")
_zookeeper_client.master_election(zk_path_pfx+"/svc-monitor", os.getpid(),
run_svc_monitor, sm_logger, args)