Skip to content

Logging and Debugging

CodingJeffRoblox edited this page Sep 23, 2026 · 1 revision

Logging and Debugging

The log file

Every run writes to logs/byterescue.log, rotated at 2 MB (byterescue/applog.py). The folder is created at runtime and is git-ignored. Open it directly with the Recovery Center's Open Log button, or in any text editor.

Before this existed (pre-0.6.0), an exception inside a Tkinter callback only ever printed to stderr — invisible when launched by double-clicking ByteRescue.bat without a console window, so an error could occur with literally no trace anywhere. Now:

  • Tk.report_callback_exception is hooked, so a GUI-callback exception is logged and shown in a dialog
  • sys.excepthook and threading.excepthook are hooked for exceptions outside GUI callbacks
  • Scan start/finish/write and results-table sync events are logged

Console output

Since 0.7.0, the same events that go to the log file also stream live to the console — whenever ByteRescue is run from one, which is the normal case: ByteRescue.ps1 launches it inside the elevated PowerShell window it opens, and leaves that window open. Console output is INFO level and up by default.

Verbose (DEBUG) logging

Set the BYTERESCUE_DEBUG environment variable to any non-empty value before launching for a fully verbose DEBUG-level stream, both to the console and the log file:

$env:BYTERESCUE_DEBUG = "1"
python -m byterescue

DEBUG-level lines cover previously-silent user actions in the Recovery Center: changing recovery mode, changing source kind, choosing a source file, choosing a destination folder, and selecting a drive — so a log from a real session shows what the user actually clicked, not just what the scan engine did internally.

Startup environment line

Every run logs its environment once at startup: ByteRescue version, Python version/executable, OS platform string, whether running elevated, and the working directory. This is exactly the information that would otherwise need to be asked for when someone reports a bug — include it (or the log line itself) in bug reports.

When reporting a bug

Attach or quote the relevant logs/byterescue.log lines, ideally reproduced with BYTERESCUE_DEBUG set. See Troubleshooting for the full checklist, and be mindful of sensitive data — don't include personal information or unrelated file paths from your log.

Related pages

Troubleshooting · Testing · How It Works

Clone this wiki locally