better time to clear logs

This commit is contained in:
vaxerski 2021-11-21 18:34:20 +01:00
parent 7bf163d45b
commit abc4c6d36e
5 changed files with 15 additions and 9 deletions

View file

@ -17,14 +17,6 @@ void ConfigManager::init() {
configValues["max_fps"].intValue = 60; configValues["max_fps"].intValue = 60;
ConfigManager::loadConfigLoadVars(); ConfigManager::loadConfigLoadVars();
// Clear logs
std::ofstream logs;
const char* const ENVHOME = getenv("HOME");
const std::string DEBUGPATH = ENVHOME + (std::string) "/.hypr.log";
logs.open(DEBUGPATH, std::ios::out | std::ios::trunc);
logs << " ";
logs.close();
} }
void handleBind(const std::string& command, const std::string& value) { void handleBind(const std::string& command, const std::string& value) {

View file

@ -5,9 +5,12 @@ Started by Vaxry on 2021 / 11 / 17
*/ */
#include <fstream>
#include "windowManager.hpp" #include "windowManager.hpp"
int main(int argc, char** argv) { int main(int argc, char** argv) {
clearLogs();
Debug::log(LOG, "Hypr debug log. Built on " + std::string(__DATE__) + " at " + std::string(__TIME__)); Debug::log(LOG, "Hypr debug log. Built on " + std::string(__DATE__) + " at " + std::string(__TIME__));
g_pWindowManager->DisplayConnection = xcb_connect(NULL, NULL); g_pWindowManager->DisplayConnection = xcb_connect(NULL, NULL);

View file

@ -14,3 +14,12 @@ std::string exec(const char* cmd) {
} }
return result; return result;
} }
void clearLogs() {
std::ofstream logs;
const char* const ENVHOME = getenv("HOME");
const std::string DEBUGPATH = ENVHOME + (std::string) "/.hypr.log";
logs.open(DEBUGPATH, std::ios::out | std::ios::trunc);
logs << " ";
logs.close();
}

View file

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "../defines.hpp" #include "../defines.hpp"
#include <fstream>
std::string exec(const char* cmd); std::string exec(const char* cmd);
void clearLogs();

View file

@ -12,6 +12,7 @@
#include "bar/Bar.hpp" #include "bar/Bar.hpp"
#include "config/ConfigManager.hpp" #include "config/ConfigManager.hpp"
#include "utilities/Monitor.hpp" #include "utilities/Monitor.hpp"
#include "utilities/Util.hpp"
class CWindowManager { class CWindowManager {
public: public: