refactor: remove DEBUG5 level and move any DEBUG5 message to DEBUG4

This commit is contained in:
sithlord48
2026-01-24 21:10:34 -05:00
committed by Chris Rizzitello
parent 046c15736b
commit d6ffcd37d7
6 changed files with 11 additions and 13 deletions

View File

@ -24,11 +24,11 @@
const int kPriorityPrefixLength = 3;
// names of priorities
static const char *g_priority[] = {"FATAL", "ERROR", "WARNING", "NOTE", "INFO", "DEBUG",
"DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4", "DEBUG5"};
static const char *g_priority[] = {"FATAL", "ERROR", "WARNING", "NOTE", "INFO",
"DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4"};
// number of priorities
static const int g_numPriority = 11;
static const int g_numPriority = 10;
// if NDEBUG (not debug) is not specified, i.e. you're building in debug,
// then set default log level to DEBUG, otherwise the max level is INFO.

View File

@ -211,7 +211,6 @@ otherwise it expands to a call that doesn't.
#define CLOG_DEBUG2 CLOG_TRACE "%z\067"
#define CLOG_DEBUG3 CLOG_TRACE "%z\070"
#define CLOG_DEBUG4 CLOG_TRACE "%z\071" // char is '9'
#define CLOG_DEBUG5 CLOG_TRACE "%z\072" // char is ':'
#define LOG_IPC(...) LOG((CLOG_IPC __VA_ARGS__))
#define LOG_PRINT(...) LOG((CLOG_PRINT __VA_ARGS__))
@ -225,4 +224,3 @@ otherwise it expands to a call that doesn't.
#define LOG_DEBUG2(...) LOG((CLOG_DEBUG2 __VA_ARGS__))
#define LOG_DEBUG3(...) LOG((CLOG_DEBUG3 __VA_ARGS__))
#define LOG_DEBUG4(...) LOG((CLOG_DEBUG4 __VA_ARGS__))
#define LOG_DEBUG5(...) LOG((CLOG_DEBUG5 __VA_ARGS__))

View File

@ -24,6 +24,5 @@ enum class LogLevel
Debug1, //!< For verbosity +1 debugging messages
Debug2, //!< For verbosity +2 debugging messages
Debug3, //!< For verbosity +3 debugging messages
Debug4, //!< For verbosity +4 debugging messages
Debug5 //!< For verbosity +5 debugging messages
Debug4 //!< For verbosity +4 debugging messages
};

View File

@ -88,7 +88,7 @@ void KeyMap::addKeyEntry(const KeyItem &item)
// add item list
entries.push_back(items);
LOG(
(CLOG_DEBUG5 "add key: %04x %d %03x %04x (%04x %04x %04x)%s", newItem.m_id, newItem.m_group, newItem.m_button,
(CLOG_DEBUG4 "add key: %04x %d %03x %04x (%04x %04x %04x)%s", newItem.m_id, newItem.m_group, newItem.m_button,
newItem.m_client, newItem.m_required, newItem.m_sensitive, newItem.m_generates, newItem.m_dead ? " dead" : "")
);
}

View File

@ -535,7 +535,7 @@ void MSWindowsScreen::saveMousePosition(int32_t x, int32_t y)
m_xCursor = x;
m_yCursor = y;
LOG_DEBUG5("saved mouse position for next delta: %+d,%+d", x, y);
LOG_DEBUG4("saved mouse position for next delta: %+d,%+d", x, y);
}
uint32_t MSWindowsScreen::registerHotKey(KeyID key, KeyModifierMask mask)
@ -883,7 +883,7 @@ bool MSWindowsScreen::onPreDispatch(HWND hwnd, UINT message, WPARAM wParam, LPAR
bool MSWindowsScreen::onPreDispatchPrimary(HWND, UINT message, WPARAM wParam, LPARAM lParam)
{
LOG_DEBUG5("handling pre-dispatch primary");
LOG_DEBUG4("handling pre-dispatch primary");
// handle event
switch (message) {
@ -955,7 +955,8 @@ bool MSWindowsScreen::onEvent(HWND, UINT msg, WPARAM wParam, LPARAM lParam, LRES
/* On windows 10 we don't receive WM_POWERBROADCAST after sleep.
We receive only WM_TIMECHANGE hence this message is used to resume.*/
case WM_TIMECHANGE:
m_events->addEvent(Event(EventTypes::ScreenResume, getEventTarget(), nullptr, Event::EventFlags::DeliverImmediately)
m_events->addEvent( //
Event(EventTypes::ScreenResume, getEventTarget(), nullptr, Event::EventFlags::DeliverImmediately)
);
break;
@ -1244,7 +1245,7 @@ bool MSWindowsScreen::onMouseMove(int32_t mx, int32_t my)
// center on the server screen. if we don't do this, then the mouse
// will always try to return to the original entry point on the
// secondary screen.
LOG_DEBUG5("centering cursor on motion: %+d,%+d", m_xCenter, m_yCenter);
LOG_DEBUG4("centering cursor on motion: %+d,%+d", m_xCenter, m_yCenter);
warpCursorNoFlush(m_xCenter, m_yCenter);
// examine the motion. if it's about the distance

View File

@ -85,7 +85,7 @@ void LogTests::printLevelToHigh()
std::stringstream buffer;
std::streambuf *old = std::cout.rdbuf(buffer.rdbuf());
m_log.print(CLOG_DEBUG5 "test message");
m_log.print(CLOG_DEBUG4 "test message");
auto string = sanitizeBuffer(buffer);
std::cout.rdbuf(old);