stanza.jupyter.logs
Log streaming for Jupyter notebooks and servers.
Module Contents
Functions
API
Wait for log file to exist or timeout.
Polls for the log file’s existence, displaying a waiting message to stderr. Exits with status 1 if the file doesn’t appear within the timeout period.
Parameters:
Path to the log file to wait for
Maximum seconds to wait before exiting
Print last N lines from log file with proper terminal alignment.
Parameters:
Path to the log file to read
Number of lines to print from the end of the file
Read and print new log lines with proper terminal alignment.
Strips carriage return artifacts from progress bars and formats output for proper terminal display. Exits if the log file is deleted.
Parameters:
Open file handle positioned at the current read position
Seconds to sleep when no new data is available
Path to the log file (for existence checking)
Stream log file until Ctrl+C.
Displays the last N lines of the log file, then continuously streams new lines as they are written. Exits gracefully on Ctrl+C.
Parameters:
Path to the log file to follow
Number of initial lines to display from the end of the file
Seconds to wait between checks for new content
Stream log file with active kernel control.
Displays the last N lines of the log file, then continuously streams new lines. Ctrl+C kills the kernel via the callback. ESC exits without killing (press twice for safety).
Parameters:
Path to the log file to follow
Function to call when Ctrl+C is pressed
Number of initial lines to display from the end of the file
Seconds to wait between checks for new content

