refactor: remove DEBUG4 level and move any DEBUG4 messages to DEBUG3

This commit is contained in:
sithlord48
2026-01-24 21:19:43 -05:00
committed by Chris Rizzitello
parent d6ffcd37d7
commit 2cf4fc8d0a
8 changed files with 10 additions and 14 deletions

View File

@ -24,11 +24,10 @@
const int kPriorityPrefixLength = 3;
// names of priorities
static const char *g_priority[] = {"FATAL", "ERROR", "WARNING", "NOTE", "INFO",
"DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4"};
static const char *g_priority[] = {"FATAL", "ERROR", "WARNING", "NOTE", "INFO", "DEBUG", "DEBUG1", "DEBUG2", "DEBUG3"};
// number of priorities
static const int g_numPriority = 10;
static const int g_numPriority = 9;
// 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

@ -210,7 +210,6 @@ otherwise it expands to a call that doesn't.
#define CLOG_DEBUG1 CLOG_TRACE "%z\066"
#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 LOG_IPC(...) LOG((CLOG_IPC __VA_ARGS__))
#define LOG_PRINT(...) LOG((CLOG_PRINT __VA_ARGS__))
@ -223,4 +222,3 @@ otherwise it expands to a call that doesn't.
#define LOG_DEBUG1(...) LOG((CLOG_DEBUG1 __VA_ARGS__))
#define LOG_DEBUG2(...) LOG((CLOG_DEBUG2 __VA_ARGS__))
#define LOG_DEBUG3(...) LOG((CLOG_DEBUG3 __VA_ARGS__))
#define LOG_DEBUG4(...) LOG((CLOG_DEBUG4 __VA_ARGS__))

View File

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

View File

@ -88,7 +88,7 @@ void KeyMap::addKeyEntry(const KeyItem &item)
// add item list
entries.push_back(items);
LOG(
(CLOG_DEBUG4 "add key: %04x %d %03x %04x (%04x %04x %04x)%s", newItem.m_id, newItem.m_group, newItem.m_button,
(CLOG_DEBUG3 "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_DEBUG4("saved mouse position for next delta: %+d,%+d", x, y);
LOG_DEBUG3("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_DEBUG4("handling pre-dispatch primary");
LOG_DEBUG3("handling pre-dispatch primary");
// handle event
switch (message) {
@ -1245,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_DEBUG4("centering cursor on motion: %+d,%+d", m_xCenter, m_yCenter);
LOG_DEBUG3("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

@ -1609,7 +1609,7 @@ void Server::onMouseUp(ButtonID id)
bool Server::onMouseMovePrimary(int32_t x, int32_t y)
{
LOG_DEBUG4("onMouseMovePrimary %d,%d", x, y);
LOG_DEBUG3("onMouseMovePrimary %d,%d", x, y);
// mouse move on primary (server's) screen
if (m_active != m_primaryClient) {

View File

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

View File

@ -32,7 +32,7 @@ int main(int argc, char **argv)
arch.init();
Log log;
log.setFilter(LogLevel::Debug4);
log.setFilter(LogLevel::Debug3);
::testing::GTEST_FLAG(throw_on_failure) = true;
testing::InitGoogleTest(&argc, argv);