Log to the instance folder
This commit is contained in:
parent
6f3b004199
commit
9486a230c7
4 changed files with 12 additions and 10 deletions
|
|
@ -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, ...) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue