feat(plugins): wire host logger factories so plugin load stops being silent#27
Merged
Conversation
…so plugin load failures stop being silent Both CLI and UI previously called PluginHost.Initialize without a logger factory, which fell back to NullLoggerFactory and dropped every plugin discovery/load event on the floor. The recent UE deploy regression (#26) was silent for that reason — plugins failed to load and the user only noticed because the Explorer dropdown was missing entries. CLI - Constructs a console-backed LoggerFactory at Information level and passes it to PluginHost.Initialize. Plugin load events flow into stderr alongside the rest of the CLI's output, matching how conversion progress is already surfaced. UI - Adds GMConverter.UI/Services/PluginLogFileProvider.cs — a minimal file-backed ILoggerProvider that writes to %TEMP%/GMConverter.Plugins.log. The provider is Avalonia-readiness-independent (plugin load runs before the UI thread dispatcher exists, so it cannot route through UiLogSink at this point in the lifecycle). Plugin load failures land in a known file the user (and future support requests) can grep when the in-app behavior doesn't match expectations. - Plumbing the file into UiLogSink so plugin events show in the in-app console panel is a worthwhile follow-up but requires restructuring UiLogSink's lifecycle (it currently field-initializes inside MainWindowViewModel) and is out of scope here. Verified: - CLI: running with any input now prints "info: GMConverter.Plugins.PluginLoader[2001] Loaded plugin gmconverter.unrealengine v0.1.0" before the conversion error or success message. - UI: %TEMP%/GMConverter.Plugins.log now contains a startup header plus the Loaded plugin entry every time the UI launches. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Follow-up to #26. Both CLI and UI were calling
PluginHost.Initializewithout a logger factory, which fell back toNullLoggerFactoryand dropped every plugin discovery/load event. That's how the UE deploy regression went unnoticed until someone opened the Explorer dropdown — plugins were failing to load and there was no visible trace.Changes
CLI
Constructs a console-backed
LoggerFactoryatInformationlevel and passes it toPluginHost.Initialize. Plugin load events flow into stderr alongside the rest of the CLI output, matching how conversion progress is already surfaced.UI
Adds
GMConverter.UI/Services/PluginLogFileProvider.cs— a minimal file-backedILoggerProviderthat writes to%TEMP%/GMConverter.Plugins.log. The provider is independent of Avalonia's readiness state (plugin load runs inProgram.Mainbefore the UI thread dispatcher exists, so it cannot route throughUiLogSinkat that point in the lifecycle without restructuring). Plugin load failures land in a known file the user (and future support requests) can grep when the in-app behavior doesn't match expectations.Sample file output:
Out of scope
Plumbing plugin events into
UiLogSinkso they show in the in-app console panel is the obviously-better UX. It requires restructuringUiLogSink's lifecycle (currently field-initialized insideMainWindowViewModel, depends onDispatcher.UIThreadwhich isn't ready at plugin-load time) and is a follow-up — not gating Source plugin migration on it.Test plan
dotnet build GMConverter.slnx -c Release→ 0 warnings, 0 errorsdotnet format --verify-no-changes→ clean%TEMP%\GMConverter.Plugins.logon every launchplugins/unrealengine/plugin.json, etc.) and confirm the error appears in stderr (CLI) and in the log file (UI)🤖 Generated with Claude Code