deeplabcut.core.debug.debug_logger
Classes:
| Name | Description |
|---|---|
ExecutableSpec |
Small description of an external executable to report. |
InMemoryDebugRecorder |
Lightweight, fail-open in-memory log recorder. |
LibrarySpec |
Small description of a library to report. |
Functions:
| Name | Description |
|---|---|
install_debug_recorder |
Attach a single in-memory recorder to the requested logger namespace. |
log_timing |
Lightweight scoped timer for debug instrumentation. |
reload_debug_settings_from_env |
Reload debug/timing settings from environment variables. |
ExecutableSpec
dataclass
Small description of an external executable to report.
Parameters
key: Label used in the output report. command: Executable name or absolute path to resolve. version_args: Arguments used to query the executable version.
Source code in deeplabcut/core/debug/debug_logger.py
InMemoryDebugRecorder
Bases: Handler
Lightweight, fail-open in-memory log recorder.
Safety properties: - bounded memory via deque(maxlen=...) - no file/network I/O - swallow-all-errors in emit() - does not log from inside itself - stores only small text snapshots
Source code in deeplabcut/core/debug/debug_logger.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
LibrarySpec
dataclass
Small description of a library to report.
Source code in deeplabcut/core/debug/debug_logger.py
install_debug_recorder
install_debug_recorder(
*,
logger_name: str = "deeplabcut",
capacity: int = LOG_QUEUE_MAXLEN,
handler_level: int = logging.INFO,
ensure_logger_level: int | None = None
) -> InMemoryDebugRecorder
Attach a single in-memory recorder to the requested logger namespace.
Idempotent: repeated calls return the same recorder.
Parameters
logger_name: Logger namespace to attach the recorder to. capacity: Maximum number of captured records. By default, uses LOG_QUEUE_MAXLEN. handler_level: Minimum level stored by the recorder itself. ensure_logger_level: Controls whether to adjust the target logger level.
- None: never modify the logger level
- int: lower the logger only if its effective level is more restrictive
Source code in deeplabcut/core/debug/debug_logger.py
log_timing
log_timing(logger: Logger, label: str, *, level: int = logging.DEBUG, threshold_ms: float | None = None)
Lightweight scoped timer for debug instrumentation.
Uses perf_counter_ns() for monotonic timing.
Logs only if logger is enabled for the requested level.
Optionally suppresses tiny timings below threshold_ms.
Source code in deeplabcut/core/debug/debug_logger.py
reload_debug_settings_from_env
Reload debug/timing settings from environment variables.