Skip to main content

A very simple logging library that logs the start and end of a process step and, in particular, indicates the elapsed time.

Project description

start-end-logging

A very simple Python logging library that logs the start and end of a process step and, in particular, indicates the elapsed time.

Installation

pip install start-end-logging or poetry add start-end-logging

Usage

import logging
import time

from start_end_logging.start_end_logging import log_start, log_end, init_logging

log = logging.getLogger(__name__)

if __name__ == "__main__":
    init_logging("../logs", "log.log")
    log_start("main process", log)
    log_start("preparing something", log)
    time.sleep(0.15)
    log_end()
    log_start("preparing something other", log)
    time.sleep(0.05)
    log_end()
    time.sleep(0.25)
    log_end()

Output:

2024-01-23 20:38:09,305 - __main__ - INFO - (1) start main process.
2024-01-23 20:38:09,305 - __main__ - INFO - (2) start preparing something.
2024-01-23 20:38:09,456 - __main__ - INFO - (2) end preparing something. time elapsed: 00:00:00.151.
2024-01-23 20:38:09,456 - __main__ - INFO - (2) start preparing something other.
2024-01-23 20:38:09,508 - __main__ - INFO - (2) end preparing something other. time elapsed: 00:00:00.052.
2024-01-23 20:38:09,758 - __main__ - INFO - (1) end main process. time elapsed: 00:00:00.453.

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

start_end_logging-0.1.5.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

start_end_logging-0.1.5-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file start_end_logging-0.1.5.tar.gz.

File metadata

  • Download URL: start_end_logging-0.1.5.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/10

File hashes

Hashes for start_end_logging-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a6dbe3df6dfc0105308169dc8360050c13d51ee763c17ffafd38768066b2984d
MD5 9a0e2c43f9bbb61da08ed892bddbb2e7
BLAKE2b-256 841e40a7501bda142c04cf190ba90b9426ec2d51539dde0509d397926f04fa3d

See more details on using hashes here.

File details

Details for the file start_end_logging-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: start_end_logging-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/10

File hashes

Hashes for start_end_logging-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 149fe0587fb610f6dbf7bc5e1c34db746d73f3293fbfbdebdfdf2bafc435de32
MD5 71414a5f57d7883122aae73ba41bda7f
BLAKE2b-256 f1f95b2471ad21b6d2b04f394bc2afa587c6fd559b4fbf767192d6d5e26ed289

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