Pain-Point SEO

How to watch a Python script run in real time from your phone

April 1, 2025 BunnyLogs Team

You kicked off a data pipeline on a remote server. It'll run for a few hours. You step away from your desk — lunch, a commute, the weekend — and you want to know if it's still running and what it's doing.

SSH requires you to be at a terminal. Email alerts are delayed and noisy. What if you could just open a browser tab on your phone and watch the log lines appear live?

What you need

Setup in 60 seconds

Sign in to BunnyLogs and create a new log stream. Copy the UUID from the URL — it looks like 3f2a1b0c-d4e5-.... That UUID is both the stream identifier and the access credential.

Install the package:

pip install bunnylogs

Add the handler to your script:

import logging
from bunnylogs import BunnyLogsHandler

logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger.addHandler(BunnyLogsHandler("your-uuid-here"))

for i in range(1000):
    logger.info(f"Processing item {i}")
    process_item(i)

logger.info("All done.")

Open https://bunnylogs.com/live/your-uuid on your phone. Log lines appear within milliseconds of being emitted.

Add useful progress milestones

Raw per-item logs are noisy for long jobs. Structured progress checkpoints make the live view far more readable:

items = fetch_items()
total = len(items)
logger.info(f"Starting job: {total} items to process")

for i, item in enumerate(items, 1):
    result = process(item)
    if i % 100 == 0:
        pct = 100 * i // total
        logger.info(f"Progress: {i}/{total} ({pct}%)")
    if result.error:
        logger.error(f"Failed item {item.id}: {result.error}")

logger.info("Job complete")

Catch silent crashes

If the script throws an unhandled exception the process exits without logging it. Add a global hook so failures land in your stream:

import sys
import logging

def _log_uncaught(exc_type, exc_value, exc_tb):
    logger.critical("Uncaught exception", exc_info=(exc_type, exc_value, exc_tb))
    sys.__excepthook__(exc_type, exc_value, exc_tb)

sys.excepthook = _log_uncaught

Now the last message in your live view will be the full traceback if something goes wrong — visible from wherever you are.

Flush before exit

The handler queues records and flushes them in a background thread. Call logging.shutdown() at the end of your script to ensure the final messages are delivered before the process exits:

if __name__ == "__main__":
    try:
        main()
    finally:
        logging.shutdown()

Share the stream with a colleague

The UUID is the only credential needed. Paste bunnylogs.com/live/your-uuid into a Slack message and anyone with it can watch the script live — no account, no permissions to configure. Revoke access by creating a new stream.

The next time you kick off a long job and step away from your desk, you don't have to wonder what it's doing.

Start streaming for free →


Related posts