Debug and logging delegate extracted from Objects.Object.
ObjDebug encapsulates all console output, MQTT log routing, progress bar,
and traceback helper methods that were previously defined directly on the
Object class in Objects.py. This reduces the size and complexity of
Objects.py while keeping the public API unchanged.
ObjDebug is a delegate, not a mixin or base class. It does not inherit
from Object or ObjData. Instead, it receives the host Object instance
as a constructor parameter and accesses host attributes (e.g. DB,
is_docker(), get_deployment(), get_package(), get_role(),
is_pytest(), log_mqtt_event()) through self._host.
# In Object.__init__:
self._debug = ObjDebug(self)
# Thin proxy on Object:
def debug(self, note, value="", value2="", value3=""):
self._debug.debug(note, value, value2, value3)
| Method | Description |
|---|---|
debug(note, value, value2, value3) |
Standard debug output (respects DO_DEBUG) |
debug_base(note, value, ..., log_level, force, log_type, no_frame_decode) |
Core logging engine with frame inspection and MQTT routing |
debug_table(note, tab) |
Print a table note |
debug_dict(note, context) |
Pretty-print a dict with timestamp |
debug_trace(error) |
Format and print a traceback |
info(note, value, value2, value3) |
Informational output (always shown) |
note(note, value, value2, value3) |
Note-level output (always shown) |
note_progress(note, value, value2, value3) |
Overwrite-in-place progress note |
warning(note, value, value2, value3) |
Warning output (always shown) |
exception(note, value, value2, value3) |
Exception output with traceback |
error(note, value, value2, value3) |
Error output; exits in non-dev/non-test environments |
show_trace(trace, err) |
Simple trace/error display (renamed from ShowTrace) |
progress_sleep(tx) |
Sleep with progress bar (renamed from ProgressSleep) |
progress_bar(iteration, total, ...) |
Console progress bar |
These constants were moved from Objects.py into this module:
_debug_console -- Shared rich.Console instance_IS_POSIX, _IS_WINDOWS -- Platform detection_ICON_DOCKER, _ICON_LOCAL, _ICON_VAMPIRE -- Rich markup icons_MQTT_EXCLUDED_MODULES, _MQTT_EXCLUDED_FUNCTIONS -- MQTT log filtering_safe_text_convert(val) -- Safe bytes/string conversion for loggingObjects.Object retains thin proxy methods with identical signatures so all
existing callers continue to work unchanged. Legacy names are aliased:
Object.ShowTrace = Object.show_traceObject.ProgressSleep = Object.progress_sleep