mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-11 18:21:54 -07:00
use a custom logging func for wlr
This commit is contained in:
@@ -12,6 +12,10 @@ void Debug::init(std::string IS) {
|
|||||||
logFile = "/tmp/hypr/" + IS + "/hyprland.log";
|
logFile = "/tmp/hypr/" + IS + "/hyprland.log";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Debug::wlrLog(wlr_log_importance level, const char* fmt, va_list args) {
|
||||||
|
Debug::log(NONE, std::string("[wlr] " + std::string(fmt)).c_str(), args);
|
||||||
|
}
|
||||||
|
|
||||||
void Debug::log(LogLevel level, const char* fmt, ...) {
|
void Debug::log(LogLevel level, const char* fmt, ...) {
|
||||||
|
|
||||||
if (disableLogs && *disableLogs)
|
if (disableLogs && *disableLogs)
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <wlr/util/log.h>
|
||||||
|
|
||||||
#define LOGMESSAGESIZE 1024
|
#define LOGMESSAGESIZE 1024
|
||||||
|
|
||||||
@@ -15,6 +16,7 @@ enum LogLevel {
|
|||||||
namespace Debug {
|
namespace Debug {
|
||||||
void init(std::string IS);
|
void init(std::string IS);
|
||||||
void log(LogLevel level, const char* fmt, ...);
|
void log(LogLevel level, const char* fmt, ...);
|
||||||
|
void wlrLog(wlr_log_importance level, const char* fmt, va_list args);
|
||||||
|
|
||||||
inline std::string logFile;
|
inline std::string logFile;
|
||||||
inline int64_t* disableLogs = nullptr;
|
inline int64_t* disableLogs = nullptr;
|
||||||
|
@@ -46,7 +46,7 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
const auto LOGWLR = getenv("HYPRLAND_LOG_WLR");
|
const auto LOGWLR = getenv("HYPRLAND_LOG_WLR");
|
||||||
if (LOGWLR && std::string(LOGWLR) == "1")
|
if (LOGWLR && std::string(LOGWLR) == "1")
|
||||||
wlr_log_init(WLR_DEBUG, nullptr);
|
wlr_log_init(WLR_DEBUG, Debug::wlrLog);
|
||||||
|
|
||||||
// let's init the compositor.
|
// let's init the compositor.
|
||||||
// it initializes basic Wayland stuff in the constructor.
|
// it initializes basic Wayland stuff in the constructor.
|
||||||
|
Reference in New Issue
Block a user