pyqt_reactive.core.log_utils

Core Log Utilities for pyqt-reactor.

Unified log discovery, classification, and monitoring utilities shared between UI implementations.

Functions

classify_log_file(log_path[, base_log_path, ...])

Pure function: Classify a log file and extract metadata.

discover_logs([base_log_path, ...])

Discover application log files and return as classified LogFileInfo objects.

get_current_log_file_path()

Get the current log file path from the logging system.

infer_base_log_path(file_path)

Infer the base log path from a subprocess log file name.

is_app_log_file(file_path)

Check if a file is a recognized application log file.

is_openhcs_log_file(file_path)

Check if a file is a recognized application log file.

is_relevant_log_file(file_path, base_log_path)

Check if file is a relevant log file for monitoring.

Classes

LogFileInfo(path, log_type[, worker_id, ...])

Information about a discovered log file.

pyqt_reactive.core.log_utils.get_current_log_file_path() str[source]

Get the current log file path from the logging system.

class pyqt_reactive.core.log_utils.LogFileInfo(path: Path, log_type: str, worker_id: str | None = None, display_name: str | None = None)[source]

Information about a discovered log file.

path: Path
log_type: str
worker_id: str | None = None
display_name: str | None = None
__post_init__()[source]

Generate display name if not provided.

__init__(path: Path, log_type: str, worker_id: str | None = None, display_name: str | None = None) None
pyqt_reactive.core.log_utils.discover_logs(base_log_path: str | None = None, include_main_log: bool = True, log_directory: Path | None = None) List[LogFileInfo][source]

Discover application log files and return as classified LogFileInfo objects.

Parameters:
  • base_log_path – Base path for specific subprocess logs (optional)

  • include_main_log – Whether to include the current main process log

  • log_directory – Directory to search (defaults to configured log directory)

Returns:

List of LogFileInfo objects for discovered log files

pyqt_reactive.core.log_utils.classify_log_file(log_path: Path, base_log_path: str | None = None, include_tui_log: bool = True) LogFileInfo[source]

Pure function: Classify a log file and extract metadata.

Parameters:
  • log_path – Path to log file

  • base_log_path – Base path for subprocess log files

  • include_tui_log – Whether to check for TUI log classification

Returns:

LogFileInfo with classification and metadata

pyqt_reactive.core.log_utils.is_relevant_log_file(file_path: Path, base_log_path: str | None) bool[source]

Check if file is a relevant log file for monitoring.

Parameters:
  • file_path – Path to file to check

  • base_log_path – Base path for subprocess log files

Returns:

True if file is relevant for monitoring

Return type:

bool

pyqt_reactive.core.log_utils.is_app_log_file(file_path: Path) bool[source]

Check if a file is a recognized application log file.

Parameters:

file_path – Path to file to check

Returns:

True if file matches configured log prefixes

Return type:

bool

pyqt_reactive.core.log_utils.infer_base_log_path(file_path: Path) str[source]

Infer the base log path from a subprocess log file name.

Parameters:

file_path – Path to subprocess log file

Returns:

Inferred base log path

Return type:

str

pyqt_reactive.core.log_utils.is_openhcs_log_file(file_path: Path) bool

Check if a file is a recognized application log file.

Parameters:

file_path – Path to file to check

Returns:

True if file matches configured log prefixes

Return type:

bool