summaryrefslogtreecommitdiff
path: root/src/debug/HyprCtl.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2023-11-14 20:06:04 +0000
committerVaxry <vaxry@vaxry.net>2023-11-14 20:06:04 +0000
commite195e51c1bd4b17398ec6964f30751b6a54bbb44 (patch)
tree31fc8158f4964943c90df98f02d8459fe37b321e /src/debug/HyprCtl.cpp
parente8469f8b1bb184a08351ee3cc3fcc4d0638eb90b (diff)
logging: move to an internal rolling log buffer
disables logging to the logfile by default
Diffstat (limited to 'src/debug/HyprCtl.cpp')
-rw-r--r--src/debug/HyprCtl.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index 217895b1..11f8d785 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -625,6 +625,20 @@ std::string animationsRequest(HyprCtl::eHyprCtlOutputFormat format) {
return ret;
}
+std::string rollinglogRequest(HyprCtl::eHyprCtlOutputFormat format) {
+ std::string result = "";
+
+ if (format == HyprCtl::FORMAT_JSON) {
+ result += "[\n\"log\":\"";
+ result += escapeJSONStrings(Debug::rollingLog);
+ result += "\"]";
+ } else {
+ result = Debug::rollingLog;
+ }
+
+ return result;
+}
+
std::string globalShortcutsRequest(HyprCtl::eHyprCtlOutputFormat format) {
std::string ret = "";
const auto SHORTCUTS = g_pProtocolManager->m_pGlobalShortcutsProtocolManager->getAllShortcuts();
@@ -1351,6 +1365,8 @@ std::string getReply(std::string request) {
return globalShortcutsRequest(format);
else if (request == "animations")
return animationsRequest(format);
+ else if (request == "rollinglog")
+ return rollinglogRequest(format);
else if (request.starts_with("plugin"))
return dispatchPlugin(request);
else if (request.starts_with("notify"))