A simple utility to tee stdout and stderr to a logfile.
Project description
tee-logfile
Small Python utility to duplicate process output to a logfile while preserving console output (similar to Unix tee).
Features
- Mirror
stdout(and optionallystderr) to a file and the console. - Lightweight and easy to integrate into scripts or pipelines.
- Designed for use on macOS and other Unix-like systems.
Requirements
- Python 3.9+
Installation
pip install tee-logfile
Usage
from tee_logfile import Tee
with Tee.context('/path/to/output.log'):
my_cli_code_to_run()
Development
release
poetry version minor
tox -e release
pip install ~/projects/sandbox/tee-logfile
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tee_logfile-0.3.9.tar.gz
(1.5 kB
view details)
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 tee_logfile-0.3.9.tar.gz.
File metadata
- Download URL: tee_logfile-0.3.9.tar.gz
- Upload date:
- Size: 1.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.13 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6001ff1e0ed5b043fc319b88cfdf270df5b13a42dda79d4a419bae83e6cca8e
|
|
| MD5 |
d1471132e0b33f09f06c87b3356b5d6d
|
|
| BLAKE2b-256 |
73c9b55287234fbef878916de3c72674affa033245c07b503545af0c00044e2b
|
File details
Details for the file tee_logfile-0.3.9-py3-none-any.whl.
File metadata
- Download URL: tee_logfile-0.3.9-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.13 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56c2c18faf4ba12157ec58a4075507146f5f73b11bed0b4682bc76c3a0e49d98
|
|
| MD5 |
db31f15b500e0f401eb5ac956aaec8d1
|
|
| BLAKE2b-256 |
08704ab8f939f231a5c837d0a63023dbfb2c65ebdbfbdd6ebdb1864a6032c6f1
|