Add a diagnostic error log, a Log button, and a version display #13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/diagnostic-log"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Adds a persistent diagnostic error log and makes it (and the running version) reachable from the UI, so intermittent problems - especially on network shares - can be investigated after the fact.
Motivation: a watcher interruption on a share (
File watcher interrupted; relying on periodic polling (Incorrect function)) was only shown transiently in the status bar and then lost, with no record of the underlying error. "Incorrect function" isERROR_INVALID_FUNCTION(Win32 1), whichFileSystemWatchercommonly raises on shares that don't support change notifications; the poll fallback covers it, but there was no durable record to confirm what else was happening.DiagnosticLog(new) - thread-safe append-only log at%APPDATA%\TaylerLogTailer\logs\diagnostic.log. Each session starts with a header recording the app version, OS, .NET runtime, process bitness, settings path, and the set of watched windows. Entries are ISO-8601 timestamped and include the exception type, message, and HResult / Win32 code. Rolls todiagnostic.log.1past 1 MB. Logging never throws.AppInfo(new) - exposes the app version (from MinVer's informational version, build metadata trimmed) and product name.FolderTailer/FileTailer- log watcher creation failures, watcher interruptions (with the full exception), poll errors, the file-limit notice, and per-file read failures. File read errors are de-duplicated per distinct message, and a resume is logged when reading recovers, so a persistently failing file does not flood the log.FolderWindow- a Log toolbar button opens a transient window that live-tails the diagnostic log folder (markedEphemeralvia a newJsonIgnoreflag onFolderConfig, so it is not remembered across runs). The status bar now shows the running version at its right-hand end, with the log path in its tooltip.How was this tested?
dotnet build Tayler.slnx -c Release- 0 errors, 0 warnings (viabuild.ps1)diagnostic.log.Checklist