log日志级别

软件内部要打印log日志,需要设计不同的日志级别。

举例

Scrapy

参考Logging — Scrapy 0.24.1 文档中就有:

Log levels

Scrapy提供5层logging级别:
1. CRITICAL - 严重错误(critical)
2. ERROR - 一般错误(regular errors)
3. WARNING - 警告信息(warning messages)
4. INFO - 一般信息(informational messages)
5. DEBUG - 调试信息(debugging messages)

scrapy.log.CRITICAL
严重错误的Log级别
scrapy.log.ERROR
错误的Log级别 Log level for errors
scrapy.log.WARNING
警告的Log级别 Log level for warnings
scrapy.log.INFO
记录信息的Log级别(生产部署时推荐的Log级别)
scrapy.log.DEBUG
调试信息的Log级别(开发时推荐的Log级别)

Supervisor

supervisor的log的日志级别:

Logging — Supervisor 3.3.4 documentation

Config File Value Output Code Description
critical CRIT Messages that indicate a condition that requires immediate user attention, a supervisor state change, or an error in supervisor itself.
error ERRO Messages that indicate a potentially ignorable error condition (e.g. unable to clear a log directory).
warn WARN Messages that indicate an anomalous condition which isn’t an error.
info INFO Normal informational output. This is the default log level if none is explicitly configured.
debug DEBG Messages useful for users trying to debug process configuration and communications behavior (process output, listener state changes, event notifications).
trace TRAC Messages useful for developers trying to debug supervisor plugins, and information about HTTP and RPC requests and responses.
blather BLAT Messages useful for developers trying to debug supervisor itself.

results matching ""

    No results matching ""