-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
GUI: Add "Generate debug log" action #3328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
C-Achard
wants to merge
18
commits into
main
Choose a base branch
from
cy/debug-logger-ui
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,587
−4
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1676f0d
Add debug recorder and reporting utilities
C-Achard 85612c1
Add debug report dialog and helpers
C-Achard c59cfba
Add debug log generation action to Help menu
C-Achard c628491
Add tests for debug logger utilities
C-Achard 8c8e208
Rename debug tests
C-Achard 1efb65a
Add license headers and tidy debug exports
C-Achard 881a9b4
Use namespaced GUI loggers
C-Achard 3965fa9
Reuse DebugTextDialog and rename hint arg
C-Achard 1e48fa6
Make debug timing and recorder configurable
C-Achard b0de21f
Fix tests
C-Achard cfe82a1
Move reload_debug_settings_from_env to debug_logger
C-Achard fa4c643
Show exec even if default None
C-Achard 8a82406
Show wait cursor while building debug text
C-Achard 968d8f1
Auto-init debug recorder logger level
C-Achard 67e250c
Fix logger level docstring
C-Achard 4f7c8e5
Snapshot iterables and remove redundant refresh
C-Achard 76c844d
Prefer module version for OpenCV; adjust logger API
C-Achard f213948
Export DebugSection and add tests for debug report
C-Achard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Add debug recorder and reporting utilities
Introduce a new debug subsystem under deeplabcut/core/debug. Adds an in-memory, bounded log recorder (InMemoryDebugRecorder) with safe fail-open semantics, helper functions to install/get the recorder, and a scoped log_timing context manager. Provides utilities to collect runtime, package, and external executable information (LibrarySpec, ExecutableSpec, collect_version_summary, collect_executable_summary, collect_debug_sections) and to format/assemble a full debug report (format_debug_report, build_debug_report). Includes small helper functions (_which, _command_version) and sane defaults (lists of core/GUI/TensorFlow libs, ffmpeg executable). Exports are wired in __init__.py.
- Loading branch information
commit 1676f0d118111ce4117a62816ce94599fa9f4c10
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| from collections.abc import Sequence | ||
|
|
||
| from .debug_logger import ( | ||
| DLC_ALL_LIBS_SPECS, | ||
| DLC_LOG_TIMING, | ||
| LOG_QUEUE_MAXLEN, | ||
|
C-Achard marked this conversation as resolved.
Outdated
|
||
| ExecutableSpec, | ||
| InMemoryDebugRecorder, | ||
| LibrarySpec, | ||
| RecordedLog, | ||
| build_debug_report, | ||
| collect_debug_sections, | ||
| collect_executable_summary, | ||
| collect_version_summary, | ||
| format_debug_report, | ||
| get_debug_recorder, | ||
| install_debug_recorder, | ||
| log_timing, | ||
| ) | ||
|
|
||
| __all__: Sequence[str] = ( | ||
| "DLC_LOG_TIMING", | ||
| "DLC_ALL_LIBS_SPECS", | ||
| "InMemoryDebugRecorder", | ||
| "LibrarySpec", | ||
| "ExecutableSpec", | ||
| "LOG_QUEUE_MAXLEN", | ||
| "RecordedLog", | ||
| "build_debug_report", | ||
| "collect_debug_sections", | ||
| "collect_version_summary", | ||
| "format_debug_report", | ||
| "get_debug_recorder", | ||
| "install_debug_recorder", | ||
| "log_timing", | ||
| "collect_executable_summary", | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import shutil | ||
| import subprocess | ||
| from collections.abc import Sequence | ||
|
C-Achard marked this conversation as resolved.
|
||
| from pathlib import Path | ||
|
|
||
|
|
||
| def _which(command: str) -> str: | ||
| try: | ||
| resolved = shutil.which(command) | ||
| return str(Path(resolved).resolve()) if resolved else "not-found" | ||
| except Exception: | ||
| return "not-found" | ||
|
|
||
|
|
||
| def _command_version(command: str, version_args: Sequence[str] = ("-version",)) -> str: | ||
| try: | ||
| completed = subprocess.run( | ||
| [command, *version_args], | ||
| check=False, | ||
| capture_output=True, | ||
| text=True, | ||
| timeout=3, | ||
| ) | ||
| except Exception: | ||
| return "unavailable" | ||
|
|
||
| text = (completed.stdout or completed.stderr or "").strip() | ||
| if not text: | ||
| return "unavailable" | ||
|
|
||
| first_line = text.splitlines()[0].strip() | ||
| return first_line or "unavailable" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.