Skip to main content

No project description provided

Project description

Log files are generated based on the time and the latest n logs are automatically retained

Example

import logging
import logging_timehandler

logger = logging.getLogger(__name__)
handler = logging_timehandler.TimeHandler('./log/%Y_%m_%d/%Y_%m_%d_%S.txt', retain=5)
handler.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
logger.addHandler(handler)
logger.setLevel(logging.INFO)

for i in range(10):
    logger.info('hello')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

logging_timehandler-0.1.0.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

logging_timehandler-0.1.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file logging_timehandler-0.1.0.tar.gz.

File metadata

  • Download URL: logging_timehandler-0.1.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.0 Windows/10

File hashes

Hashes for logging_timehandler-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ab856e4d41c813b88ef31ef9a039616fb8efe606ea0527d9081c0572670b770
MD5 8abf7cc1a1bd5558eeac87419ddaadae
BLAKE2b-256 eea6e844522b8c6052eb1e7061cef6692ced7d7035c83feb7111f88daf491974

See more details on using hashes here.

File details

Details for the file logging_timehandler-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for logging_timehandler-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 451c4334d055b9fe9ad544e318f2272276e9e3a0434d3a333cb11f61864746be
MD5 b5f7d636e5c9c1c948b7894f1c69038f
BLAKE2b-256 8254465ff4c9d57683438b80f86db507c686ca1004f219f424ca3638fa3dcfa9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page