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.7.tar.gz (1.5 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.7-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

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

Hashes for tee_logfile-0.3.7.tar.gz
Algorithm Hash digest
SHA256 eae48e1d41351fae421abf63829cea6da819fcb22b01a7a0fec34072d7b7c6c9
MD5 897b13c11692be0212000a5d6b7c8438
BLAKE2b-256 7d15a10379f7ea5e8365d7da8360b703b60f29d0a4b162a14703d122b065717b

See more details on using hashes here.

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

Hashes for tee_logfile-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0c01bde49294617578b5cef0856cf460788f9d11020d6dbc40fa7db1a253f199
MD5 0b6a2e09cc0c0c6d2c4d6915ce32c49a
BLAKE2b-256 7c1024ac6192e704fd171b140ee8321452a86b4f058c0c5f85492a1c666bbba5

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