diff options
Diffstat (limited to 'core/string/print_string.h')
-rw-r--r-- | core/string/print_string.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/string/print_string.h b/core/string/print_string.h index 6496384b3f..7656e9bfa1 100644 --- a/core/string/print_string.h +++ b/core/string/print_string.h @@ -59,7 +59,15 @@ void remove_print_handler(const PrintHandlerList *p_handler); extern void __print_line(String p_string); extern void __print_line_rich(String p_string); extern void print_error(String p_string); -extern void print_verbose(String p_string); +extern bool is_print_verbose_enabled(); + +// This version avoids processing the text to be printed until it actually has to be printed, saving some CPU usage. +#define print_verbose(m_text) \ + { \ + if (is_print_verbose_enabled()) { \ + print_line(m_text); \ + } \ + } inline void print_line(Variant v) { __print_line(stringify_variants(v)); |