Skip to content

fix: replace all Debug.WriteLine with ILogger across src/design/#765

Merged
dangershony merged 1 commit intomainfrom
fix/design-error-handling
Apr 18, 2026
Merged

fix: replace all Debug.WriteLine with ILogger across src/design/#765
dangershony merged 1 commit intomainfrom
fix/design-error-handling

Conversation

@dangershony
Copy link
Copy Markdown
Member

Summary

  • Replace all 27 instances of System.Diagnostics.Debug.WriteLine with proper ILogger infrastructure across 16 files in src/design/
  • Add proper error handling with onError callbacks for Rx subscriptions and ThrownExceptions subscriptions on reactive commands
  • Fix empty/silent catch blocks by adding structured logging

Approach

Three patterns used depending on context:

Context Pattern
Static classes (ExplorerHelper, ImageCacheService) Lazy static ILogger resolved from App.Services
View code-behind files ILogger<T> resolved in constructor via App.Services.GetRequiredService<ILoggerFactory>()
ViewModels (DeployFlowViewModel) ILogger<T> via constructor injection from DI

Files changed

  • ExplorerHelper.cs — 3 calls converted (lazy static logger)
  • CreateProjectStep3View.axaml.cs — 1 call
  • ShellViewModel.cs — 2 calls (PrototypeSettings + ShellViewModel)
  • ManageProjectView.axaml.cs — 1 call
  • FundsView.axaml.cs — 1 call
  • ShareModal.axaml.cs — 4 calls
  • ProjectInfoJsonModal.axaml.cs — 1 call
  • ManageProjectModalsView.axaml.cs — 4 calls (also cleaned duplicate usings)
  • SettingsView.axaml.cs — 1 call
  • ReceiveFundsModal.axaml.cs — 1 call
  • WalletDetailModal.axaml.cs — 1 call
  • DeployFlowViewModel.cs — 4 calls (DI-injected logger)
  • ImageCacheService.cs — 5 calls (previously converted)
  • MyProjectsViewModel.cs, SettingsViewModel.cs, InvestPageViewModel.cs — error handling improvements

Verification

  • dotnet build src/design/App.Desktop/App.Desktop.csproj0 errors
  • grep -r "Debug.WriteLine" src/design/0 results

Migrate all 27 instances of System.Diagnostics.Debug.WriteLine to proper
ILogger infrastructure using the project's existing patterns: lazy static
loggers for static classes, ILoggerFactory resolution from App.Services
for view code-behind, and constructor-injected ILogger<T> for ViewModels.
@dangershony dangershony merged commit 7516446 into main Apr 18, 2026
3 checks passed
@dangershony dangershony deleted the fix/design-error-handling branch April 18, 2026 18:39
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.

1 participant