testbot.result.logger
Module Contents
Classes
Filter instances are used to perform arbitrary filtering of LogRecords. |
|
日志管理器,可注册多个日志对象,支持模块日志和用例日志分离。 |
Functions
|
将目标文件夹压缩成zip包并且输出到output_file |
|
Attributes
- testbot.result.logger._zip_directory(dirpath, output_file)[source]
将目标文件夹压缩成zip包并且输出到output_file 并且将文件删除
- class testbot.result.logger.PackageFilter[source]
Bases:
logging.Filter
Filter instances are used to perform arbitrary filtering of LogRecords.
Loggers and Handlers can optionally use Filter instances to filter records as desired. The base filter class only allows events which are below a certain point in the logger hierarchy. For example, a filter initialized with “A.B” will allow events logged by loggers “A.B”, “A.B.C”, “A.B.C.D”, “A.B.D” etc. but not “A.BB”, “B.A.B” etc. If initialized with the empty string, all events are passed.
- class testbot.result.logger.LoggerManager[source]
Bases:
object
日志管理器,可注册多个日志对象,支持模块日志和用例日志分离。
- register(logger_name: str, filename: str = None, console: bool = True, default_level: str = logging.INFO, **kwargs) logging.Logger [source]
注册logger。 for_test参数默认False,开启则支持模块日志;is_test参数默认False,开启则支持用例日志。
- Parameters:
logger_name (str) – 日志名称
filename (str) – 文件名称
console (bool) – 是否控制台输出
default_level (str) – 默认日志级别
kwargs –
- Returns:
创建或已注册的日志Logger对象
- Return type:
logging.Logger