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.7.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.7.tar.gz.
File metadata
- Download URL: tee_logfile-0.3.7.tar.gz
- Upload date:
- Size: 1.5 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 |
eae48e1d41351fae421abf63829cea6da819fcb22b01a7a0fec34072d7b7c6c9
|
|
| MD5 |
897b13c11692be0212000a5d6b7c8438
|
|
| BLAKE2b-256 |
7d15a10379f7ea5e8365d7da8360b703b60f29d0a4b162a14703d122b065717b
|
File details
Details for the file tee_logfile-0.3.7-py3-none-any.whl.
File metadata
- Download URL: tee_logfile-0.3.7-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 |
0c01bde49294617578b5cef0856cf460788f9d11020d6dbc40fa7db1a253f199
|
|
| MD5 |
0b6a2e09cc0c0c6d2c4d6915ce32c49a
|
|
| BLAKE2b-256 |
7c1024ac6192e704fd171b140ee8321452a86b4f058c0c5f85492a1c666bbba5
|