summaryrefslogtreecommitdiff
path: root/indra/test/print.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-02-23 10:01:53 -0500
committerNat Goodspeed <nat@lindenlab.com>2024-02-23 10:01:53 -0500
commit11f6fe1579a67377b5922338a72acaf348546fa3 (patch)
tree3dc437b3921de0e9a36bdbdb810740f82d14fdeb /indra/test/print.h
parente993b7973510449147db9ac630bff95197a03aff (diff)
Allow print() (also Debug) to be used even in normal viewer code.
Since print() writes to cerr, we used to be able to use it only in test programs. Making the cerr writes conditional on LL_TEST allows us to use it for debugging the code under test as well, since in the normal viewer the cerr statements vanish.
Diffstat (limited to 'indra/test/print.h')
-rw-r--r--indra/test/print.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/indra/test/print.h b/indra/test/print.h
index 08e36caddf..749603907e 100644
--- a/indra/test/print.h
+++ b/indra/test/print.h
@@ -23,7 +23,9 @@ struct NONL_t {};
inline
void print()
{
+#ifdef LL_TEST
std::cerr << std::endl;
+#endif
}
// print(NONL) is a no-op
@@ -35,8 +37,10 @@ void print(NONL_t)
template <typename T, typename... ARGS>
void print(T&& first, ARGS&&... rest)
{
+#ifdef LL_TEST
std::cerr << first;
print(std::forward<ARGS>(rest)...);
+#endif
}
#endif /* ! defined(LL_PRINT_H) */