Bring back C# sample logging!

This commit is contained in:
Caelan Sayler
2025-03-12 22:02:47 +00:00
committed by Caelan
parent 4f10c94565
commit a6337c5a22
7 changed files with 113 additions and 25 deletions

View File

@@ -6,6 +6,8 @@ namespace CSharpAvalonia;
class Program
{
public static MemoryLogger Log { get; private set; } = new();
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
@@ -16,6 +18,7 @@ class Program
// It's important to Run() the VelopackApp as early as possible in app startup.
VelopackApp.Build()
.OnFirstRun((v) => { /* Your first run code here */ })
.SetLogger(Log)
.Run();
// Now it's time to run Avalonia