当前位置: 首页>>代码示例>>Python>>正文


Python SandeshLogger.get_py_logger_level方法代码示例

本文整理汇总了Python中pysandesh.sandesh_logger.SandeshLogger.get_py_logger_level方法的典型用法代码示例。如果您正苦于以下问题:Python SandeshLogger.get_py_logger_level方法的具体用法?Python SandeshLogger.get_py_logger_level怎么用?Python SandeshLogger.get_py_logger_level使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pysandesh.sandesh_logger.SandeshLogger的用法示例。


在下文中一共展示了SandeshLogger.get_py_logger_level方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: log

# 需要导入模块: from pysandesh.sandesh_logger import SandeshLogger [as 别名]
# 或者: from pysandesh.sandesh_logger.SandeshLogger import get_py_logger_level [as 别名]
 def log(self, log_msg, level=SandeshLevel.SYS_DEBUG, fun=None):
     if fun:
         log = fun(level=level, og_msg=log_msg, sandesh=self._sandesh)
         log.send(sandesh=self._sandesh)
     else:
         self._sandesh.logger().log(
                 SandeshLogger.get_py_logger_level(level), log_msg)
开发者ID:Juniper,项目名称:contrail-controller,代码行数:9,代码来源:vnc_logger.py

示例2: send_database_status

# 需要导入模块: from pysandesh.sandesh_logger import SandeshLogger [as 别名]
# 或者: from pysandesh.sandesh_logger.SandeshLogger import get_py_logger_level [as 别名]
 def send_database_status(self):
     cassandra_status_uve = CassandraStatusUVE()
     cassandra_status = CassandraStatusData()
     cassandra_status.cassandra_compaction_task = CassandraCompactionTask()
     # Get compactionstats
     compaction_count = subprocess.Popen("nodetool compactionstats|grep 'pending tasks:'",
         shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     op, err = compaction_count.communicate()
     if compaction_count.returncode != 0:
         msg = "Failed to get nodetool compactionstats " + err
         self.msg_log(msg, level=SandeshLevel.SYS_ERR)
         return
     cassandra_status.cassandra_compaction_task.pending_compaction_tasks = \
         self.get_pending_compaction_count(op)
     # Get the tpstats value
     tpstats_op = subprocess.Popen(["nodetool", "tpstats"], stdout=subprocess.PIPE,
                                   stderr=subprocess.PIPE)
     op, err = tpstats_op.communicate()
     if tpstats_op.returncode != 0:
         msg = "Failed to get nodetool tpstats " + err
         self.msg_log(msg, level=SandeshLevel.SYS_ERR)
         return
     cassandra_status.thread_pool_stats = self.get_tp_status(op)
     cassandra_status.name = socket.gethostname()
     cassandra_status_uve = CassandraStatusUVE(data=cassandra_status)
     msg = 'Sending UVE: ' + str(cassandra_status_uve)
     self.sandesh_global.logger().log(SandeshLogger.get_py_logger_level(
                         SandeshLevel.SYS_DEBUG), msg)
     cassandra_status_uve.send()
开发者ID:avallark,项目名称:contrail-controller,代码行数:31,代码来源:database_event_manager.py

示例3: syslog

# 需要导入模块: from pysandesh.sandesh_logger import SandeshLogger [as 别名]
# 或者: from pysandesh.sandesh_logger.SandeshLogger import get_py_logger_level [as 别名]
    def syslog(self, msg, *args, **kwargs):
        if not self._logger:
            return
        level = kwargs.get('level', 'info')
        if isinstance(level, int):
            from pysandesh.sandesh_logger import SandeshLogger
            level = SandeshLogger.get_py_logger_level(level)

        log_method = getattr(self._logger, level, self._logger.info)
        log_method(msg)
开发者ID:secof,项目名称:contrail-controller,代码行数:12,代码来源:zkclient.py

示例4: syslog

# 需要导入模块: from pysandesh.sandesh_logger import SandeshLogger [as 别名]
# 或者: from pysandesh.sandesh_logger.SandeshLogger import get_py_logger_level [as 别名]
 def syslog(self, log_msg, level):
     """ Log to syslog. """
     self._sandesh.logger().log(
         SandeshLogger.get_py_logger_level(level), log_msg)
开发者ID:cijohnson,项目名称:contrail-controller,代码行数:6,代码来源:logger.py

示例5: msg_log

# 需要导入模块: from pysandesh.sandesh_logger import SandeshLogger [as 别名]
# 或者: from pysandesh.sandesh_logger.SandeshLogger import get_py_logger_level [as 别名]
 def msg_log(self, msg, level):
     self.sandesh_global.logger().log(SandeshLogger.get_py_logger_level(
                         level), msg)
开发者ID:dsundarraj,项目名称:contrail-controller,代码行数:5,代码来源:vrouter_event_manager.py

示例6: _logger

# 需要导入模块: from pysandesh.sandesh_logger import SandeshLogger [as 别名]
# 或者: from pysandesh.sandesh_logger.SandeshLogger import get_py_logger_level [as 别名]
 def _logger(self, msg, level):
     logging.log(SandeshLogger.get_py_logger_level(level), msg)
开发者ID:dsundarraj,项目名称:contrail-controller,代码行数:4,代码来源:test_alarmgen_config_handler.py

示例7: msg_log

# 需要导入模块: from pysandesh.sandesh_logger import SandeshLogger [as 别名]
# 或者: from pysandesh.sandesh_logger.SandeshLogger import get_py_logger_level [as 别名]
 def msg_log(self, msg, level):
     self.logger.log(SandeshLogger.get_py_logger_level(level), msg)
开发者ID:cijohnson,项目名称:contrail-controller,代码行数:4,代码来源:loadbalancer_stats.py


注:本文中的pysandesh.sandesh_logger.SandeshLogger.get_py_logger_level方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。