Aelog

An simple, async, full package name path, log rotating, different colored log library.

aelog aims to make using python log as simple as possible. as a result, it drastically simplifies using python logging.

aelog’s design objectives:

  • Make using python log as simple as possible.
  • Output log contains the full package name path.
  • Provide asynchronous log output function, at the same time, contains common log output.
  • Output according to the log level to mark the different colors separately.
  • Provide a log file rotating, automatic backup.
  • Output to the terminal and file, default output to the terminal, if you don’t provide the log file path.

Installing aelog

  • pip install aelog

init aelog

aelog config

List of configuration keys that the aelog extension recognizes:

configuration key the meaning of the configuration key
AELOG_ACCESS_FILE Access file path, default None.
AELOG_ERROR_FILE Error file path, default None.
AELOG_CONSOLE Whether it is output at the terminal, default false.
AELOG_MAX_BYTES Log file size, default 50M.
AELOG_BACKUP_COUNT Rotating file count, default 5.

Usage

simple using, not initialized.

This will output to the terminal.

console
  • Different levels of logging, different color, the color is cyan, green, yellow, red and ‘bold_red,bg_white’ in turn.

To initialize, output log to file and terminal.

This will output to the test.log file and terminal.

console
  • Automatic output is greater than the error information to the ‘test_error.log’ file.
  • Different levels of logging, different color, the color is cyan, green, yellow, red and ‘bold_red,bg_white’ in turn.

To initialize, asynchronous output log to file and terminal.

This will output to the test.log file and terminal.

console
  • Automatic output is greater than the error information to the ‘test_error.log’ file.
  • Different levels of logging, different color, the color is cyan, green, yellow, red and ‘bold_red,bg_white’ in turn.

Changelog

[1.0.3] - 2018-12-23

Added

  • 增加init_app初始化方法,可以直接传入app初始化(参考类flask扩展的方式)
  • 增加指定错误日志文件的功能,如没有指定则和老版本处理方式相同

Changed

  • 修改init_aelog实现方式,增加警告内容
  • 增加log文件的校验,保证是log结尾的日志文件
  • 重构部分内容

[1.0.1] - 2018-03-28

Added

  • 测试完成,发布到pypi

Changed

  • 修改直接在终端执行报错的问题

[1.0.0] - 2018-03-25

Added

  • Make using python log as simple as possible.
  • Output log contains the full package name path.
  • Provide asynchronous log output function, at the same time, contains common log output.
  • Output according to the log level to mark the different colors separately.
  • Provide a log rotating, automatic backup.
  • Default output to the terminal, if you don’t provide the log file path.
  • Edit readme,push to pypi, and so on.