Skip to main content

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 optionally stderr) 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


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.8.tar.gz (1.6 kB view details)

Uploaded Source

Built Distribution

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

tee_logfile-0.3.8-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

Details for the file tee_logfile-0.3.8.tar.gz.

File metadata

  • Download URL: tee_logfile-0.3.8.tar.gz
  • Upload date:
  • Size: 1.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.13 Darwin/24.6.0

File hashes

Hashes for tee_logfile-0.3.8.tar.gz
Algorithm Hash digest
SHA256 e9ece0dd3560f7d2de565b3a464123357bb11e89e7d6a41a8244cd366add3032
MD5 2e8b47913e5c01188f013ae62adebb86
BLAKE2b-256 ea97a873788c6e34e70d2c1306981f77349f8449a5b1b30a68a80564dc1528e6

See more details on using hashes here.

File details

Details for the file tee_logfile-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: tee_logfile-0.3.8-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

Hashes for tee_logfile-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 61f4425474886dfad4fa4557f3eeaa5625e48b22bea2e044f476d059c8c45500
MD5 0bfbcac54ee06f24801bf5c630e0ef4a
BLAKE2b-256 64f145335a94cb281d1985616eec94f4d856812fd8053e2e3b2806367f1674d2

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