当前位置: 首页>>代码示例>>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;未经允许,请勿转载。