Overhaul logging.

This commit is contained in:
gibbed
2020-02-28 14:30:48 -06:00
committed by Rick Gibbed
parent de3c91ab2c
commit a48bb71c2f
107 changed files with 954 additions and 854 deletions

View File

@@ -12,6 +12,8 @@
#include <cstdint>
#include "third_party/fmt/include/fmt/format.h"
namespace xe {
namespace debugging {
@@ -25,10 +27,18 @@ bool IsDebuggerAttached();
// If no debugger is present, a signal will be raised.
void Break();
namespace internal {
void DebugPrint(const char* s);
}
// Prints a message to the attached debugger.
// This bypasses the normal logging mechanism. If no debugger is attached it's
// likely to no-op.
void DebugPrint(const char* fmt, ...);
template <typename... Args>
void DebugPrint(fmt::string_view format, const Args&... args) {
internal::DebugPrint(
fmt::vformat(format, fmt::make_format_args(args...)).c_str());
}
} // namespace debugging
} // namespace xe