Log Widget¶
Widgets for displaying and handling log output.
Preview
Classes¶
FXOutputLogWidget
¶
Bases:
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 |
|---|---|---|---|
|
|
Parent widget. |
None
|
|
|
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()
Methods:
| Name | Description |
|---|---|
|
Initialize the output log widget. |
|
Append text to the log output with ANSI color conversion. |
|
Clear the log output. |
|
Handle widget close event to restore output streams. |
|
Handle keyboard shortcuts. |
|
Remove logging handler from all loggers where it was added. |
__init__
¶
Initialize the output log widget.
append_log
¶
Append text to the log output with ANSI color conversion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|
Text to append (may contain ANSI color codes). |
required |
closeEvent
¶
Handle widget close event to restore output streams.
restore_output_streams
¶
Remove logging handler from all loggers where it was added.
FXOutputLogHandler
¶
Bases:
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 |
|---|---|---|---|
|
|
The |
required |
Methods:
| Name | Description |
|---|---|
|
Emit a log record to the output log widget. |