Log to the instance folder

This commit is contained in:
vaxerski
2022-06-03 17:48:07 +02:00
parent 6f3b004199
commit 9486a230c7
4 changed files with 12 additions and 10 deletions

View File

@@ -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, ...) {