summaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-03 17:48:07 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-03 17:48:07 +0200
commit9486a230c74e8873621fdf64a33adaaa660762e3 (patch)
tree0f0ee90736428b6b1bed1198e3e3db9be07c0dc3 /src/debug
parent6f3b004199a6b1bb0a8f5431d677ab926bdf19f3 (diff)
Log to the instance folder
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/Log.cpp7
-rw-r--r--src/debug/Log.hpp2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/debug/Log.cpp b/src/debug/Log.cpp
index b3d13583..559e7b79 100644
--- a/src/debug/Log.cpp
+++ b/src/debug/Log.cpp
@@ -1,14 +1,15 @@
#include "Log.hpp"
#include "../defines.hpp"
+#include "../Compositor.hpp"
#include <fstream>
#include <iostream>
-void Debug::init() {
+void Debug::init(std::string IS) {
if (ISDEBUG)
- logFile = "/tmp/hypr/hyprlandd-" + std::to_string(time(NULL)) + ".log";
+ logFile = "/tmp/hypr/" + IS + "/hyprlandd.log";
else
- logFile = "/tmp/hypr/hyprland-" + std::to_string(time(NULL)) + ".log";
+ logFile = "/tmp/hypr/" + IS + "/hyprland.log";
}
void Debug::log(LogLevel level, const char* fmt, ...) {
diff --git a/src/debug/Log.hpp b/src/debug/Log.hpp
index d5aa6958..2a7ab425 100644
--- a/src/debug/Log.hpp
+++ b/src/debug/Log.hpp
@@ -12,7 +12,7 @@ enum LogLevel {
};
namespace Debug {
- void init();
+ void init(std::string IS);
void log(LogLevel level, const char* fmt, ...);
inline std::string logFile;