GitXplorerGitXplorer
g

tee-output

public
15 stars
1 forks
2 issues

Commits

List of commits on branch main.
Unverified
c41f8ff383200320b746e953e92709ae1b505a71

Bump version

ggdb committed a year ago
Verified
12f8a06de47afc583b544657cabaf7afd921deb4

Merge pull request #2 from camillol/fixioctl

ggdb committed a year ago
Unverified
effd67a6731ba584bde15f26996fdc06370d4f50

Avoid ioctl error when stdin is not a terminal

ccamillol committed a year ago
Unverified
d582596a60a59d2d019e8ff6dcde6edb09c3af1a

Add cleaner drain behavior

ggdb committed 2 years ago
Unverified
7d7af066e56c68033ba442b2b71ef18b65dee151

Add --term support to parent-lifetime

ggdb committed 2 years ago
Unverified
ddb794f8cdf0d41ab64370ebc740c02bf25266bb

Make parent-lifetime more robust

ggdb committed 3 years ago

README

The README file for this repository.

Tee Output

tee-output is a Python library to tee standard output / standard error from the current process into a logfile. Unlike doing a shell redirection (i.e. python myscript.py 2>&1 | tee /tmp/log), tee-output preserves terminal semantics, so breakpoint() etc continue to work.

Basic usage:

from tee_output import tee
tee("/tmp/log.out", "/tmp/log.err")

After running the above, your standard output will stream to /tmp/stdout.out in addition to the terminal; your standard error will stream to /tmp/stdout.err in addition to the terminal.

You can also provide a list of locations to tee:

from tee_output import tee
tee(["/tmp/log.out", "/tmp/log.combined"], ["/tmp/log.err", "/tmp/log.combined"])

This will additionally create a file /tmp/log.combined which contains the interleaved standard output and error, such as you see in your terminal.