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.5.tar.gz
(1.6 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.5.tar.gz.
File metadata
- Download URL: tee_logfile-0.3.5.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.11.13 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39b8bd1b9bdf57191aebc8377488494e5d2e980131e5d4972399fc44c94a3107
|
|
| MD5 |
81fe05c0969ba004dce99342ce52ccf2
|
|
| BLAKE2b-256 |
9eccaff0ebca1f75220fc397826abad2b2cb6e51712849c470d27e8051cb772b
|
File details
Details for the file tee_logfile-0.3.5-py3-none-any.whl.
File metadata
- Download URL: tee_logfile-0.3.5-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.11.13 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
828e05589d872910e1f2193beb6464be51c98d314d37179eebdb6583ea82a965
|
|
| MD5 |
8533b7e7d2dcd35180eac3d69703e6db
|
|
| BLAKE2b-256 |
8f5f480f211e3a93bb097644f4d27346c33a3d47c04d75f2bda388c5d26b49a9
|