log_widget
_log_widget
¶
Output log widget with ANSI color support.
Classes:
| Name | Description |
|---|---|
FXOutputLogHandler |
Custom logging handler that sends log messages to an output log widget. |
FXOutputLogWidget |
A reusable read-only output log widget for displaying application logs. |
Classes¶
FXOutputLogHandler
¶
FXOutputLogHandler(log_widget: FXOutputLogWidget)
Bases: Handler
flowchart TD
fxgui.fxwidgets._log_widget.FXOutputLogHandler[FXOutputLogHandler]
click fxgui.fxwidgets._log_widget.FXOutputLogHandler href "" "fxgui.fxwidgets._log_widget.FXOutputLogHandler"
Custom logging handler that sends log messages to an output log widget.
This handler is used internally by FXOutputLogWidget to capture
log messages and display them in the widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
FXOutputLogWidget
|
The |
required |
Methods:
| Name | Description |
|---|---|
emit |
Emit a log record to the output log widget. |
FXOutputLogWidget
¶
FXOutputLogWidget(
parent: Optional[QWidget] = None, capture_output: bool = False
)
Bases: QWidget
flowchart TD
fxgui.fxwidgets._log_widget.FXOutputLogWidget[FXOutputLogWidget]
click fxgui.fxwidgets._log_widget.FXOutputLogWidget href "" "fxgui.fxwidgets._log_widget.FXOutputLogWidget"
A reusable read-only output log widget for displaying application logs.
This widget provides a text display area that captures and shows logging output from the application. It supports ANSI color codes, search functionality, and log throttling for performance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Optional[QWidget]
|
Parent widget. |
None
|
|
bool
|
If |
False
|
Signals
log_message: Emitted when a log message is received (for thread-safe delivery).
Examples:
>>> from fxgui import fxwidgets
>>> log_widget = fxwidgets.FXOutputLogWidget(capture_output=True)
>>> log_widget.show()
Initialize the output log widget.
Methods:
| Name | Description |
|---|---|
append_log |
Append text to the log output with ANSI color conversion. |
clear_log |
Clear the log output. |
closeEvent |
Handle widget close event to restore output streams. |
keyPressEvent |
Handle keyboard shortcuts. |
restore_output_streams |
Remove logging handler from all loggers where it was added. |