ddcLogs

Custom log with rotations


Keywords
python3, log, log-utils, ddcLogs
License
MIT
Install
pip install ddcLogs==1.0.1

Documentation

Few Utility Functions

License Python PyPi Build Status

Install

pip install ddcLogs

Logs

  • Setup Logging
    • Logs will rotate based on when variable to a .tar.gz file, defaults to midnight
    • Logs will be deleted based on the days_to_keep variable, defaults to 7
    • Current 'when' events supported:
      • S - Seconds
      • M - Minutes
      • H - Hours
      • D - Days
      • midnight - roll over at midnight
      • W{0-6} - roll over on a certain day; 0 - Monday
from ddcLogs import TimedRotatingLog
log = TimedRotatingLog(
    level = "info",
    directory = "logs",
    filename = "app.log",
    encoding = "UTF-8",
    days_to_keep = 7,
    when = "midnight",
    utc = True
)
log.init()

Source Code

Build

poetry build

Run Tests

poe test

Get Coverage Report

poe coverage

License

Released under the MIT License