feat: comprehensive logging overhaul for better debugging and diagnostics#1488
feat: comprehensive logging overhaul for better debugging and diagnostics#1488
Conversation
- Add extension initialization progress logging (native finder, manager registration, env selection, setup complete with timings) - Add discovery START/END logging in InternalEnvironmentManager.refresh() - Fix wrong log levels: traceError→traceWarn for non-error conditions (uvPythonInstaller, nativePythonFinder), traceInfo→traceVerbose for clipboard operations - Add distinguishing context to terminal env var injector catch handlers - Add environment creation logging in envCommands - Promote setEnvironment logging to traceInfo and log unconditionally - Add pyenv discovery source logging for all lookup paths - Enhance discovery summary to include managers with 0 environments - Update tests to match traceError→traceWarn change Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
|
@copilot fix merge conflicts |
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Fixed in 1f8c526. The conflict was in |
Fixed in 1f8c526. The conflict was in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
Overhauls logging across the extension to make debugging environment discovery and startup issues much easier for users and maintainers. The goal is that when something goes wrong (environments not found, startup stuck, selection not persisting), the Output panel logs tell a clear story of what happened and where.
Changes (10 files, +47/-25 lines)
1. Extension initialization progress (
extension.ts)Added
traceInfoat each stage boundary with timing so users can see exactly where startup gets stuck:2. Discovery START/END logging (
internal.api.ts)Every discovery operation now unconditionally logs:
[Manager] Discovering environments...at start[Manager] Discovery complete: N environments found (X.Xs)at end3. Fixed wrong log levels
uvPythonInstaller.ts:traceError→traceWarnfor curl/wget fallback (not an error)nativePythonFinder.ts:traceError→traceWarnfor global-level workspace setting (config issue, not runtime error)envCommands.ts:traceInfo→traceVerbosefor clipboard copy operations (too minor for info)4. Error context disambiguation (
terminalEnvVarInjector.ts)4 previously identical "Failed to update environment variables" error messages now have distinguishing context:
(global reload),(no workspace folder for URI),for workspace: <name>,(settings change)5. Environment creation logging (
envCommands.ts)createEnvironmentCommandandcreateAnyEnvironmentCommandnow log on success with the environment name.6. Environment selection logging (
envManagers.ts)setEnvironmentpromoted fromtraceVerbosetotraceInfoand logs unconditionally (not just when persisting settings), showing env name, ID, scope, and manager.7. Pyenv discovery parity (
pyenvUtils.ts)Added discovery source logging to match other managers (conda, pipenv, poetry):
PYENV_ROOT, home directory,pyenv-win, PATH lookup, and "not found" message. Also logs discovery count.8. Discovery summary enhancement (
telemetry/helpers.ts)logDiscoverySummarynow includes ALL managers in the summary (even those with 0 environments or errors), making it clear which managers were checked.Validation