Skip to content
/ tee-output Public

A Python library that tees the standard output & standard error from the current process to files on disk, while preserving terminal semantics (so breakpoint(), etc work as normal)

Notifications You must be signed in to change notification settings

gdb/tee-output

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A Python library that tees the standard output & standard error from the current process to files on disk, while preserving terminal semantics (so breakpoint(), etc work as normal)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published