Skip to content

VS Code WinGet log viewer tool#6149

Open
JohnMcPMS wants to merge 4 commits intomicrosoft:masterfrom
JohnMcPMS:vscode-log-ext
Open

VS Code WinGet log viewer tool#6149
JohnMcPMS wants to merge 4 commits intomicrosoft:masterfrom
JohnMcPMS:vscode-log-ext

Conversation

@JohnMcPMS
Copy link
Copy Markdown
Member

@JohnMcPMS JohnMcPMS commented Apr 16, 2026

A VS Code log viewer for WinGet logs (default for WinGet-*.log and WinGetCOM-*.log). I've wanted this for quite some time and with some vibe experienced professional guided AI coding I have this. Up front, I don't know if we will be able to put it in the VS Code marketplace at this time due to resource constraints. It should be easy enough to make a local .vsix with npm run package from the directory and install the generated file.

It supports:

  • Line filtering and term highlighting search
  • Level filtering and coloring
  • Channel filtering and badges
  • Subchannel filtering (mostly for configuration logs)
  • Log line time deltas
  • Tail viewing
  • Line wraps
  • Jumping between error lines
image

There is a debug command that generates log lines of every type (shown in the image). It includes a --follow argument that generates lines every few seconds for a while to check the tail feature.

There is one significant product change, which is outputting the log level to the file now, of the format <L> where L is the level character:

2026-04-15 11:17:40.453 <I> [FAIL] Log viewer test: Failure channel

Future

Work required to make this available broadly:

  • Automated tests built in the VS code test infrastructure
  • Public pipeline execution of said tests
  • Internal pipeline build, sign, package validation testing
  • Likely some internal process for acceptance to publish under Microsoft organization
  • Internal publishing pipeline updates
Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner April 16, 2026 17:42
@github-actions

This comment has been minimized.

@github-actions

This comment was marked as outdated.


- No inline `style="..."` attributes in HTML — **always use CSS classes or `element.style.property = value`** via CSSOM
- Script/style nonces are replaced at runtime in `logViewerProvider.ts`
- After any edit to `media/viewer.js`, validate syntax: `node --check media/viewer.js`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this file in particular?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I told it to leave instructions for itself 🤷

Comment on lines +68 to +76
| `FAIL` | red | 🔴 |
| `CLI` | blue | 🔵 |
| `SQL` | purple | 🟣 |
| `REPO` | light-blue/cyan | 🩵 |
| `YAML` | yellow | 🟡 |
| `CORE` | white/light-gray | ⬜ |
| `TEST` | green | 🟢 |
| `CONF` | gray | 🩶 |
| `WORK` | orange | 🟠 |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It bothers me that not all the emoji are the same shame...

}
}

// ── LogViewerTestCommand ─────────────────────────────────────────────────────
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have these type of comments elsewhere?

Comment on lines +419 to +433
AICLI_LOG(CLI, Info, << "[SQL ] Subchannel test: database query initiated for package lookup");
AICLI_LOG(CLI, Info, << "[REPO] Subchannel test: fetching package metadata from remote source");

// ── Continuation lines (newlines in the message become continuation rows) ──
AICLI_LOG(Core, Warning, << "Package installation encountered multiple issues:\n"
" - Dependency 'vcredist' version 14.0.30704 not found in any configured source\n"
" - Insufficient disk space on C:\\ (requires 512 MB, available 203 MB)\n"
" - Installation directory is read-only: C:\\Program Files\\TestPackage\\1.0.0");

// ── Long line (should require horizontal scroll or wrap in the viewer) ─
AICLI_LOG(Workflow, Info, << "Resolving full package dependency graph: The following packages are required "
"as dependencies and will be installed in sequence if not already present on the system: "
"Microsoft.VCRedist.2015+.x64 (>= 14.0.30704), Microsoft.DotNet.Runtime.7 (>= 7.0.14), "
"Microsoft.WebView2.Runtime (>= 113.0.1774.35), Microsoft.WindowsAppRuntime.1.4 (>= 1.4.231219000). "
"Total estimated download size: 847 MB across 4 installers.");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why you would use test strings that look like real logs instead of just quoting the classics like the bee movie script

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖

Comment on lines +476 to +492
// Every 5 iterations: multi-line status summary (continuation lines).
if (i % 5 == 0)
{
AICLI_LOG(Core, Info, << "Follow iteration " << i << " status summary:\n"
" Packages checked: " << (i * 7) << "\n"
" Updates available: " << (i % 3) << "\n"
" Sources refreshed: 2");
}

// Every 20 iterations: simulated error with a stack trace (continuation lines + HRESULT).
if (i % 20 == 0)
{
AICLI_LOG(Fail, Error, << "Simulated transient error at follow iteration " << i << " [HRESULT 0x80070005]:\n"
" at AppInstaller::Repository::SourceList::OpenSource(std::string_view)\n"
" at AppInstaller::CLI::Workflow::OpenSourcesForSearch(Context&)\n"
" at AppInstaller::CLI::LogViewerTestCommand::ExecuteInternal(Context&)");
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You had the perfect opportunity to do FizzBuzz in your real job and you didn't take it...

protected:
void ExecuteInternal(Execution::Context& context) const override;
};
// Tests the log viewer extension by emitting logs that exercise all channels, levels, subchannels,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: add blank line before

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't *.js and *.js.map files also be in the .gitignore?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the .vscodeignore? Maybe, but understanding that is part of the "things required to actually ship this".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize that this wasn't compiled from a .ts. But the ones in out/ definitely don't need to be checked in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants