Report.h 455 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Format.h>
  8. extern bool g_report_to_debug;
  9. template<typename... Ts>
  10. void reportln(const StringView& format, Ts... args)
  11. {
  12. if (g_report_to_debug) {
  13. AK::VariadicFormatParams variadic_format_params { args... };
  14. AK::vdbgln(format, variadic_format_params);
  15. } else {
  16. warnln(format, args...);
  17. }
  18. }