本文整理汇总了Python中pysandesh.sandesh_base.Sandesh.trace_buffer_create方法的典型用法代码示例。如果您正苦于以下问题:Python Sandesh.trace_buffer_create方法的具体用法?Python Sandesh.trace_buffer_create怎么用?Python Sandesh.trace_buffer_create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pysandesh.sandesh_base.Sandesh
的用法示例。
在下文中一共展示了Sandesh.trace_buffer_create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: JobLogger
# 需要导入模块: from pysandesh.sandesh_base import Sandesh [as 别名]
# 或者: from pysandesh.sandesh_base.Sandesh import trace_buffer_create [as 别名]
class JobLogger(ConfigServiceLogger):
def __init__(self, args=None, http_server_port=None,
sandesh_instance_id=None, sandesh_instance=None):
self.sandesh_instance_id = sandesh_instance_id
self._sandesh = sandesh_instance
module = Module.FABRIC_ANSIBLE
module_pkg = "job_manager"
self.context = "job_manager"
super(JobLogger, self).__init__(
module, module_pkg, args, http_server_port)
def sandesh_init(self, http_server_port=None):
""" Init sandesh """
if self._sandesh is not None:
return
self._sandesh = Sandesh()
self.redefine_sandesh_handles()
if not http_server_port:
http_server_port = self._args.http_server_port
self._instance_id = self.sandesh_instance_id
self._sandesh.init_generator(
self._module_name, self._hostname, self._node_type_name,
self.sandesh_instance_id, self._args.random_collectors,
'%s_context' % self.context, int(http_server_port),
['cfgm_common'],
logger_class=self._args.logger_class,
logger_config_file=self._args.logging_conf,
config=self._args.sandesh_config)
self._sandesh.set_logging_params(
enable_local_log=self._args.log_local,
category=self._args.log_category,
level=self._args.log_level,
file=self._args.log_file,
enable_syslog=self._args.use_syslog,
syslog_facility=self._args.syslog_facility)
VncGreenlet.register_sandesh_handler()
self._sandesh.trace_buffer_create(name="MessageBusNotifyTraceBuf",
size=1000)