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:
@@ -1,6 +1,8 @@
|
||||
using System.Net.Http;
|
||||
using System.Text.Json;
|
||||
using ytLive.Models;
|
||||
using AppLogErrorClass = ytLive.Helpers.AppLogErrorClass;
|
||||
using AppLogMessageType = ytLive.Helpers.AppLogMessageType;
|
||||
using AppLog = ytLive.Helpers.AppLog;
|
||||
|
||||
namespace ytLive.Services;
|
||||
@@ -54,7 +56,8 @@ public class ChannelStatsService
|
||||
// (insufficientPermissions / quotaExceeded / …) — the bare code was
|
||||
// undiagnosable for the 2026-09-23 auditDetails 403.
|
||||
var errorBody = await response.Content.ReadAsStringAsync();
|
||||
AppLog.Write($"YPP stats: channels.list failed ({(int)response.StatusCode}): {errorBody}");
|
||||
AppLog.Write($"YPP stats: channels.list failed ({(int)response.StatusCode}): {errorBody}",
|
||||
AppLogMessageType.Error, AppLogErrorClass.Class2);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -107,7 +110,8 @@ public class ChannelStatsService
|
||||
$"{ApiBase}/playlistItems?part=snippet&playlistId={Uri.EscapeDataString(uploadsPlaylistId)}&maxResults=50");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
AppLog.Write($"YPP stats: playlistItems.list failed ({(int)response.StatusCode})");
|
||||
AppLog.Write($"YPP stats: playlistItems.list failed ({(int)response.StatusCode})",
|
||||
AppLogMessageType.Error, AppLogErrorClass.Class2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -129,4 +133,4 @@ public class ChannelStatsService
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user