diff --git a/include/components/bar.hpp b/include/components/bar.hpp index e40a4c25..5e6856d4 100644 --- a/include/components/bar.hpp +++ b/include/components/bar.hpp @@ -536,7 +536,7 @@ class bar : public xpp::event::sink(action.button), action.start_x, action.end_x, action.command); #if DEBUG and DRAW_CLICKABLE_AREA_HINTS m_log.info("Drawing clickable area hints"); @@ -587,32 +587,33 @@ class bar : public xpp::event::sink lck(m_lock); { - m_log.trace("bar: Received button press event: %i at pos(%i, %i)", + m_log.trace_x("bar: Received button press event: %i at pos(%i, %i)", static_cast(evt->detail), evt->event_x, evt->event_y); mousebtn button = static_cast(evt->detail); for (auto&& action : m_actions) { if (action.active) { - m_log.trace("bar: Ignoring action: unclosed)"); + m_log.trace_x("bar: Ignoring action: unclosed)"); continue; } else if (action.button != button) { - m_log.trace("bar: Ignoring action: button mismatch"); + m_log.trace_x("bar: Ignoring action: button mismatch"); continue; } else if (action.start_x > evt->event_x) { - m_log.trace( + m_log.trace_x( "bar: Ignoring action: start_x(%i) > event_x(%i)", action.start_x, evt->event_x); continue; } else if (action.end_x < evt->event_x) { - m_log.trace("bar: Ignoring action: end_x(%i) < event_x(%i)", action.end_x, evt->event_x); + m_log.trace_x( + "bar: Ignoring action: end_x(%i) < event_x(%i)", action.end_x, evt->event_x); continue; } m_log.info("Found matching input area"); m_log.trace("action.command = %s", action.command); - m_log.trace("action.button = %i", static_cast(action.button)); - m_log.trace("action.start_x = %i", action.start_x); - m_log.trace("action.end_x = %i", action.end_x); + m_log.trace_x("action.button = %i", static_cast(action.button)); + m_log.trace_x("action.start_x = %i", action.start_x); + m_log.trace_x("action.end_x = %i", action.end_x); if (g_signals::bar::action_click) g_signals::bar::action_click(action.command); @@ -678,7 +679,7 @@ class bar : public xpp::event::sink(align)); + m_log.trace_x("bar: alignment_change(%i)", static_cast(align)); m_bar.align = align; if (align == alignment::LEFT) { @@ -697,7 +698,7 @@ class bar : public xpp::event::sink(attr)}; if ((m_attributes & val) != 0) return; - m_log.trace("bar: attribute_set(%i)", val); + m_log.trace_x("bar: attribute_set(%i)", val); m_attributes |= val; } //}}} @@ -708,7 +709,7 @@ class bar : public xpp::event::sink(attr)}; if ((m_attributes & val) == 0) return; - m_log.trace("bar: attribute_unset(%i)", val); + m_log.trace_x("bar: attribute_unset(%i)", val); m_attributes ^= val; } //}}} @@ -717,7 +718,7 @@ class bar : public xpp::event::sink(attr)}; - m_log.trace("bar: attribute_toggle(%i)", val); + m_log.trace_x("bar: attribute_toggle(%i)", val); m_attributes ^= val; } //}}} @@ -727,7 +728,7 @@ class bar : public xpp::event::sink(btn), cmd); + m_log.trace_x("bar: action_block_open(%i, %s)", static_cast(btn), cmd); action_block action; action.active = true; action.align = m_bar.align; @@ -741,7 +742,7 @@ class bar : public xpp::event::sink(btn)); + m_log.trace_x("bar: action_block_close(%i)", static_cast(btn)); for (auto i = m_actions.size(); i > 0; i--) { auto& action = m_actions[i - 1]; @@ -776,7 +777,7 @@ class bar : public xpp::event::sink %s)", static_cast(gc_), color_.hex(), color_.rgb()); const uint32_t value_list[32]{color_.value()}; @@ -790,7 +791,7 @@ class bar : public xpp::event::sinkset_preferred_font(index); } //}}} @@ -798,7 +799,7 @@ class bar : public xpp::event::sink +#ifdef ENABLE_VERBOSE_TRACELOG + void trace_x(string message, Args... args) const { + output(loglevel::TRACE, message, args...); + } +#else + void trace_x(string, Args...) const {} +#endif + /** * Output an info message */ diff --git a/include/config.hpp.cmake b/include/config.hpp.cmake index 17f21df0..6b5c6e22 100644 --- a/include/config.hpp.cmake +++ b/include/config.hpp.cmake @@ -16,6 +16,8 @@ #cmakedefine DISABLE_TRAY #cmakedefine DISABLE_DRAW +#cmakedefine ENABLE_VERBOSE_TRACELOG + #ifdef DEBUG #cmakedefine01 DRAW_CLICKABLE_AREA_HINTS #cmakedefine DRAW_CLICKABLE_AREA_HINTS_OFFSET_Y @DRAW_CLICKABLE_AREA_HINTS_OFFSET_Y@ diff --git a/include/modules/meta.hpp b/include/modules/meta.hpp index 02e86af4..56726f85 100644 --- a/include/modules/meta.hpp +++ b/include/modules/meta.hpp @@ -514,7 +514,7 @@ namespace modules { while (CONST_MOD(Impl).enabled()) { for (auto&& w : watches) { - this->m_log.trace("%s: Poll inotify watch %s", CONST_MOD(Impl).name(), w->path()); + this->m_log.trace_x("%s: Poll inotify watch %s", CONST_MOD(Impl).name(), w->path()); std::lock_guard lck(this->m_updatelock); if (w->poll(1000 / watches.size())) {