Release v0.2.0 with incident diagnostics and in-app log viewer

This commit is contained in:
2026-10-28 01:38:30 +02:00
parent 076210dc9c
commit cf18a0a3c5
15 changed files with 678 additions and 27 deletions
+14
View File
@@ -1,6 +1,7 @@
#pragma once
#include "core.h"
#include <filesystem>
#include <deque>
#include <objbase.h>
#include <span>
#include <stdexcept>
@@ -50,4 +51,17 @@ void configureAutostart(int mode);
std::wstring executable();
std::wstring lastError(const std::wstring &context);
void log(const std::wstring &message);
std::wstring diagnosticText(const std::wstring &text);
// A bounded, short-lived context. A problem drains it, so old incidents are not repeated.
class DiagnosticBuffer
{
std::deque<std::pair<ULONGLONG, std::wstring>> entries;
public:
std::wstring record(const std::wstring &message, bool problem, ULONGLONG now);
void clear() { entries.clear(); }
};
void setLoggingEnabled(bool enabled);
void diagnosticEvent(const std::wstring &message, bool problem = false);
std::wstring readDiagnosticLog(bool previous);
void clearDiagnosticLog(bool previous);
} // namespace ks