{"id":24689,"library":"tee-output","title":"tee-output","description":"A utility to tee standard output/standard error from the current process into a logfile while preserving terminal semantics (e.g., breakpoint() works). Current version 0.4.16. Stable release cadence.","status":"active","version":"0.4.16","language":"python","source_language":"en","source_url":"https://github.com/leogregianin/tee-output","tags":["logging","tee","stdout","stderr","output-redirection"],"install":[{"cmd":"pip install tee-output","lang":"bash","label":"Install"}],"dependencies":[],"imports":[{"note":"Primary class for teeing output.","wrong":null,"symbol":"TeeOutput","correct":"from tee_output import TeeOutput"},{"note":"Utility to define TRACE level.","wrong":null,"symbol":"add_logging_level","correct":"from tee_output import add_logging_level"}],"quickstart":{"code":"import logging\nfrom tee_output import TeeOutput\n\nlogging.basicConfig(stream=open('app.log', 'w'), level=logging.INFO)\ntee = TeeOutput('app.log')\ntee.start()\n\nprint('Hello, tee!')\nlogging.info('This goes to both console and file.')\ntee.stop()","lang":"python","description":"Basic example: tee stdout/stderr to a file while preserving terminal interaction."},"warnings":[{"fix":"Ensure `tee.start()` is called at the very beginning of the script, before any print or logging.","message":"Call `start()` before output is generated; otherwise output before start is not captured.","severity":"gotcha","affected_versions":"all"},{"fix":"Always call `tee.stop()` after teeing is done, or use it as a context manager.","message":"Do not forget to call `stop()` to restore original stdout/stderr; otherwise residual buffering may occur.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `logging.getLogger().setLevel(logging.TRACE)` or define custom level via `logging.addLevelName()`.","message":"The `add_logging_level` function is deprecated in favor of standard logging.setLevel.","severity":"deprecated","affected_versions":">=0.4.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from tee_output import TeeOutput`.","cause":"Incorrect import or misspelled class name.","error":"AttributeError: module 'tee_output' has no attribute 'TeeOutput'"},{"fix":"Instantiate: `tee = TeeOutput('log.txt')` then call `tee.start()`.","cause":"Forgetting to instantiate the class.","error":"TypeError: 'TeeOutput' object is not callable"},{"fix":"Provide a valid file path, e.g., `TeeOutput('output.log')`.","cause":"File path is a directory or invalid filename.","error":"OSError: [Errno 22] Invalid argument"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}