From 6f3b004199a6b1bb0a8f5431d677ab926bdf19f3 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 3 Jun 2022 17:41:57 +0200 Subject: IPC and log changes, introduce signature --- src/debug/Log.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/debug/Log.cpp') diff --git a/src/debug/Log.cpp b/src/debug/Log.cpp index 3a008758..b3d13583 100644 --- a/src/debug/Log.cpp +++ b/src/debug/Log.cpp @@ -4,12 +4,18 @@ #include #include +void Debug::init() { + if (ISDEBUG) + logFile = "/tmp/hypr/hyprlandd-" + std::to_string(time(NULL)) + ".log"; + else + logFile = "/tmp/hypr/hyprland-" + std::to_string(time(NULL)) + ".log"; +} + void Debug::log(LogLevel level, const char* fmt, ...) { // log to a file - const std::string DEBUGPATH = ISDEBUG ? "/tmp/hypr/hyprlandd.log" : "/tmp/hypr/hyprland.log"; std::ofstream ofs; - ofs.open(DEBUGPATH, std::ios::out | std::ios::app); + ofs.open(logFile, std::ios::out | std::ios::app); switch (level) { case LOG: -- cgit v1.2.3