Skip to content

Commit 29376cb

Browse files
committed
Add PRINT_VERBOSE macro alongside the function
1 parent 681fb04 commit 29376cb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/godot_cpp/core/print_string.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,12 @@ void print_verbose(const Variant &p_variant, Args... p_args) {
6767

6868
bool is_print_verbose_enabled();
6969

70+
// This version avoids processing the text to be printed until it actually has to be printed, saving some CPU usage.
71+
#define PRINT_VERBOSE(m_variant) \
72+
{ \
73+
if (is_print_verbose_enabled()) { \
74+
print_line(m_variant); \
75+
} \
76+
}
77+
7078
} // namespace godot

0 commit comments

Comments
 (0)