當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。