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;
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) {

View file

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

View file

@ -13,4 +13,13 @@ std::string exec(const char* cmd) {
result += buffer.data();
}
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
#include "../defines.hpp"
#include <fstream>
std::string exec(const char* cmd);
void clearLogs();

View file

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