mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-21 06:53:48 -07:00
internal: Wayland Protocol impl improvements (#2944)
This commit is contained in:
@@ -33,6 +33,9 @@ void Debug::log(LogLevel level, const char* fmt, ...) {
|
||||
if (disableLogs && *disableLogs)
|
||||
return;
|
||||
|
||||
if (level == TRACE && !trace)
|
||||
return;
|
||||
|
||||
// log to a file
|
||||
std::ofstream ofs;
|
||||
ofs.open(logFile, std::ios::out | std::ios::app);
|
||||
@@ -43,6 +46,7 @@ void Debug::log(LogLevel level, const char* fmt, ...) {
|
||||
case ERR: ofs << "[ERR] "; break;
|
||||
case CRIT: ofs << "[CRITICAL] "; break;
|
||||
case INFO: ofs << "[INFO] "; break;
|
||||
case TRACE: ofs << "[TRACE] "; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
@@ -4,14 +4,14 @@
|
||||
|
||||
#define LOGMESSAGESIZE 1024
|
||||
|
||||
enum LogLevel
|
||||
{
|
||||
enum LogLevel {
|
||||
NONE = -1,
|
||||
LOG = 0,
|
||||
WARN,
|
||||
ERR,
|
||||
CRIT,
|
||||
INFO
|
||||
INFO,
|
||||
TRACE
|
||||
};
|
||||
|
||||
namespace Debug {
|
||||
@@ -23,4 +23,5 @@ namespace Debug {
|
||||
inline int64_t* disableLogs = nullptr;
|
||||
inline int64_t* disableTime = nullptr;
|
||||
inline bool disableStdout = false;
|
||||
inline bool trace = false;
|
||||
};
|
Reference in New Issue
Block a user