當前位置: 首頁>>代碼示例>>Python>>正文


Python Logger.log方法代碼示例

本文整理匯總了Python中gunicorn.glogging.Logger.log方法的典型用法代碼示例。如果您正苦於以下問題:Python Logger.log方法的具體用法?Python Logger.log怎麽用?Python Logger.log使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gunicorn.glogging.Logger的用法示例。


在下文中一共展示了Logger.log方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: critical

# 需要導入模塊: from gunicorn.glogging import Logger [as 別名]
# 或者: from gunicorn.glogging.Logger import log [as 別名]
def critical(self, msg, *args, **kwargs):
        Logger.critical(self, msg, *args, **kwargs)
        self.increment("gunicorn.log.critical", 1) 
開發者ID:RoseOu,項目名稱:flasky,代碼行數:5,代碼來源:statsd.py

示例2: error

# 需要導入模塊: from gunicorn.glogging import Logger [as 別名]
# 或者: from gunicorn.glogging.Logger import log [as 別名]
def error(self, msg, *args, **kwargs):
        Logger.error(self, msg, *args, **kwargs)
        self.increment("gunicorn.log.error", 1) 
開發者ID:RoseOu,項目名稱:flasky,代碼行數:5,代碼來源:statsd.py

示例3: warning

# 需要導入模塊: from gunicorn.glogging import Logger [as 別名]
# 或者: from gunicorn.glogging.Logger import log [as 別名]
def warning(self, msg, *args, **kwargs):
        Logger.warning(self, msg, *args, **kwargs)
        self.increment("gunicorn.log.warning", 1) 
開發者ID:RoseOu,項目名稱:flasky,代碼行數:5,代碼來源:statsd.py

示例4: exception

# 需要導入模塊: from gunicorn.glogging import Logger [as 別名]
# 或者: from gunicorn.glogging.Logger import log [as 別名]
def exception(self, msg, *args, **kwargs):
        Logger.exception(self, msg, *args, **kwargs)
        self.increment("gunicorn.log.exception", 1)

    # Special treatement for info, the most common log level 
開發者ID:RoseOu,項目名稱:flasky,代碼行數:7,代碼來源:statsd.py

示例5: info

# 需要導入模塊: from gunicorn.glogging import Logger [as 別名]
# 或者: from gunicorn.glogging.Logger import log [as 別名]
def info(self, msg, *args, **kwargs):
        self.log(logging.INFO, msg, *args, **kwargs)

    # skip the run-of-the-mill logs 
開發者ID:RoseOu,項目名稱:flasky,代碼行數:6,代碼來源:statsd.py

示例6: log

# 需要導入模塊: from gunicorn.glogging import Logger [as 別名]
# 或者: from gunicorn.glogging.Logger import log [as 別名]
def log(self, lvl, msg, *args, **kwargs):
        """Log a given statistic if metric, value and type are present
        """
        try:
            extra = kwargs.get("extra", None)
            if extra is not None:
                metric = extra.get(METRIC_VAR, None)
                value = extra.get(VALUE_VAR, None)
                typ = extra.get(MTYPE_VAR, None)
                if metric and value and typ:
                    if typ == GAUGE_TYPE:
                        self.gauge(metric, value)
                    elif typ == COUNTER_TYPE:
                        self.increment(metric, value)
                    elif typ == HISTOGRAM_TYPE:
                        self.histogram(metric, value)
                    else:
                        pass

            # Log to parent logger only if there is something to say
            if msg is not None and len(msg) > 0:
                Logger.log(self, lvl, msg, *args, **kwargs)
        except Exception:
            Logger.warning(self, "Failed to log to statsd", exc_info=True)

    # access logging 
開發者ID:RoseOu,項目名稱:flasky,代碼行數:28,代碼來源:statsd.py

示例7: debug

# 需要導入模塊: from gunicorn.glogging import Logger [as 別名]
# 或者: from gunicorn.glogging.Logger import log [as 別名]
def debug(self, msg, *args, **kwargs):
        self.log(logging.DEBUG, msg, *args, **kwargs) 
開發者ID:Jeremy-Friedman,項目名稱:metrics,代碼行數:4,代碼來源:statsd.py


注:本文中的gunicorn.glogging.Logger.log方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。