feat(ui): color and acknowledge pinned log errors

Add independent AppLog message types and explicit Class 1/2 severity. Wrap and color log rows, pin Class 1 above Class 2, and let acknowledgement return entries to the current-launch timeline without changing file format or rotation.

Ref: https://logtape.org/manual/levels
This commit is contained in:
2026-11-02 18:17:18 -08:00
parent 01a3fcaaf7
commit a6aea5bf26
23 changed files with 365 additions and 100 deletions
+7 -5
View File
@@ -29,7 +29,7 @@ public partial class MainViewModel : ViewModelBase
}
catch (Exception ex)
{
AppLog.Write(ex, "Recording: failed to prepare output path");
AppLog.Write(ex, "Recording: failed to prepare output path", AppLogErrorClass.Class2);
return null;
}
}
@@ -45,7 +45,8 @@ public partial class MainViewModel : ViewModelBase
if (!File.Exists(startPath))
{
AppLog.Write($"Recording: output not found for rename: {startPath}");
AppLog.Write($"Recording: output not found for rename: {startPath}",
AppLogMessageType.Error, AppLogErrorClass.Class2);
return;
}
_recordLength = _liveElapsed;
@@ -64,7 +65,7 @@ public partial class MainViewModel : ViewModelBase
switch (result.Outcome)
{
case RecordingSaveOutcome.Saved:
AppLog.Write($"Recording saved: {result.FinalPath}");
AppLog.WriteSuccess($"Recording saved: {result.FinalPath}");
_notifications.Info("Recording saved",
Path.GetFileName(result.FinalPath!) +
" — you can rename it in your videos folder at any time.");
@@ -77,7 +78,8 @@ public partial class MainViewModel : ViewModelBase
case RecordingSaveOutcome.DiscardFailed:
// A "discarded" recording still sitting on disk is worse than no
// report at all — name the file and the folder so it can be found.
AppLog.Write($"Recording discard failed: {startPath}");
AppLog.Write($"Recording discard failed: {startPath}",
AppLogMessageType.Error, AppLogErrorClass.Class2);
_notifications.Error("Recording discarded?",
$"Could not delete {Path.GetFileName(startPath)} — it is still in {dir}.");
break;
@@ -85,7 +87,7 @@ public partial class MainViewModel : ViewModelBase
}
catch (Exception ex)
{
AppLog.Write(ex, "Recording: rename-on-stop failed");
AppLog.Write(ex, "Recording: rename-on-stop failed", AppLogErrorClass.Class2);
_notifications.Error("Recording saved",
$"The recording was written but couldn't be renamed: {Path.GetFileName(startPath)}");
}