Events & Logging
biopro_sdk.plugin.events
Central EventBus for BioPro SDK.
Provides a singleton event bus using PyQt signals to allow asynchronous and decoupled communication between different plugins and the core application.
biopro_sdk.plugin.logging
BioPro SDK Logging Utilities.
Provides BioPro-aware loggers that automatically attach plugin metadata and route to the central diagnostic engine.
PluginLoggerAdapter
Bases: LoggerAdapter
Logger adapter that injects plugin_id into every log record.
Source code in src/biopro_sdk/plugin/logging.py
__init__(logger, plugin_id)
Initialize the logger adapter with a specific plugin identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger
|
Logger
|
The parent Python logger instance to adapt. |
required |
plugin_id
|
str
|
The unique identifier of the target plugin. |
required |
Source code in src/biopro_sdk/plugin/logging.py
process(msg, kwargs)
Process log messages to inject the plugin metadata context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
msg
|
The actual log message content. |
required | |
kwargs
|
Thread or level attributes associated with the log record. |
required |
Returns:
| Type | Description |
|---|---|
|
A tuple of (processed_message, kwargs) containing the updated extra dict. |
Source code in src/biopro_sdk/plugin/logging.py
get_logger(name, plugin_id=None)
Get a logger instance, optionally adapted for a specific plugin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the logger (usually name) |
required |
plugin_id
|
str | None
|
The ID of the plugin this logger belongs to |
None
|
Returns:
| Type | Description |
|---|---|
Logger | PluginLoggerAdapter
|
A logging.Logger or PluginLoggerAdapter instance. |
Source code in src/biopro_sdk/plugin/logging.py
biopro_sdk.plugin.signals
Standard plugin signals for BioPro SDK.
This module defines all standard PyQt6 signals that plugins should emit to communicate state changes and results to the BioPro core application.
PluginSignals
Bases: QObject
Standard signals that all plugins emit.
Plugins should use these signals to ensure consistent communication with BioPro core and other plugins.
Attributes:
| Name | Type | Description |
|---|---|---|
status_message |
Emitted with a short status string for the UI status bar |
|
log_message |
Emitted with detailed log messages |
|
state_changed |
Emitted when plugin state changes |
|
undo_available |
Emitted with bool indicating if undo is available |
|
redo_available |
Emitted with bool indicating if redo is available |
|
analysis_started |
Emitted when analysis begins |
|
analysis_progress |
Emitted with int (0-100) for progress |
|
analysis_complete |
Emitted when analysis finishes |
|
analysis_error |
Emitted with error message if analysis fails |
|
data_changed |
Emitted when underlying data changes |