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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file start_end_logging-0.1.7.tar.gz.
File metadata
- Download URL: start_end_logging-0.1.7.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36482a508ec2a96be3709770afe2e55d09c3c074360c61e3a2e98ff5f52e002b
|
|
| MD5 |
90d06371a6c65f528bed0dbde2052b01
|
|
| BLAKE2b-256 |
8bea95688d96d760e3c85a6fccd6d3d2e87a7a39c275395ae034e90b7d10a1fc
|
File details
Details for the file start_end_logging-0.1.7-py3-none-any.whl.
File metadata
- Download URL: start_end_logging-0.1.7-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60ec30f5728633c5bbe6187c2b85a098388c6a7636e8242c04b6aca61738da5b
|
|
| MD5 |
bc3cca2aaed4f2122c12cb04c830d488
|
|
| BLAKE2b-256 |
b866bbbcdc93f3c4d037d264f4625751cd852e9727b99a9b227a4681da259b96
|