Skip to main content

A time logger for Python programs

Project description

timelogger: A stopwatch-like time logger for Python programs

It provides:
  • Tracking time spent throughout a program in a method similar to a stopwatch
  • Output via standard Python logger for simplicity
Original use case:
  • Python program containing many packages and modules
  • Needed ability to log time gaps in a centralized way.
    • e.g. time consumed for imports or function calls
  • pip install timelogger

    (Tested for Python >=3.6.5 on Linux (Ubuntu) and Windows 7/10)

  • short example:

    # Set up your root logger, or use logcontrol
    import logcontrol
    # Import the package
    import timelogger
    # Customize the package logger, if needed
    logcontrol.register_logger(timelogger.logger, "timelogger")
    logcontrol.set_level(logcontrol.DEBUG, group="timelogger")
    # Add a start time with a relevant name
    # imports of other packages for example purposes
    import binascii
    import decimal
    import hashlib
    import requests
    # To log the time differential, set a stop time for the same name
    # To set a specific log level for the time differential logs: (default is logging.INFO)

Project details

Download files

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

Files for timelogger, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size timelogger-0.0.3-py3-none-any.whl (5.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size timelogger-0.0.3.tar.gz (17.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page