feat: add Launcher Next .NET 8 foundation

This commit is contained in:
codex
2026-07-31 14:56:56 +03:00
parent 2e972f6a61
commit 175fcef8a9
24 changed files with 317 additions and 0 deletions
@@ -0,0 +1,8 @@
using System.Text.Json;
using Launcher.Next.Core;
namespace Launcher.Next.Observability;
public sealed class JsonlTelemetry(string logRoot) : ILauncherTelemetry
{
public void Write(string eventType, IReadOnlyDictionary<string, object?>? fields = null)
{ try { Directory.CreateDirectory(logRoot); var allowed = (fields ?? new Dictionary<string, object?>()).Where(x => !x.Key.Contains("user", StringComparison.OrdinalIgnoreCase) && !x.Key.Contains("token", StringComparison.OrdinalIgnoreCase) && !x.Key.Contains("password", StringComparison.OrdinalIgnoreCase)).ToDictionary(); var line = JsonSerializer.Serialize(new { Timestamp = DateTimeOffset.UtcNow, EventType = eventType, Fields = allowed }); File.AppendAllText(Path.Combine(logRoot, DateTime.UtcNow.ToString("yyyyMMdd") + ".jsonl"), line + Environment.NewLine); } catch { } }
}
@@ -0,0 +1 @@
<Project Sdk="Microsoft.NET.Sdk"><ItemGroup><ProjectReference Include="..\Launcher.Next.Core\Launcher.Next.Core.csproj" /></ItemGroup></Project>