Release v0.2.0 with incident diagnostics and in-app log viewer
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user