#include "Stroika/Foundation/StroikaPreComp.h"
#include <array>
#include <span>
#include <thread>
#include "Stroika/Foundation/Common/Common.h"
#include "Stroika/Foundation/Debug/CompileTimeFlagChecker.h"
#include "Stroika/Foundation/Time/Realtime.h"
#include "Trace.inl"
Go to the source code of this file.
Classes | |
class | Stroika::Foundation::Debug::TraceContextBumper |
class | Stroika::Foundation::Debug::TraceContextSuppressor |
Namespaces | |
namespace | Stroika::Foundation |
namespace | Stroika::Foundation::Characters |
Macros | |
#define | qStroika_Foundation_Debug_TraceToFile 0 |
#define | qStroika_Foundation_Debug_ShowThreadIndex 1 |
if true, emit a much shorter thread ID, making - I suspect (testing) for terser and clearer tracelogs. Only downside is that you must find first occurrence of that index to find real threadId, and use that in waits, etc. | |
#define | Stroika_Foundation_Debug_OptionalizeTraceArgs(...) |
#define | DbgTrace _NoOp_ |
Functions | |
wstring | Stroika::Foundation::Debug::GetDbgTraceThreadName (thread::id threadID) |
#define qStroika_Foundation_Debug_TraceToFile 0 |
If qStroika_Foundation_Debug_TraceToFile is set true, then DbgTrace () and other Trace calls all go both to the usual debugger output screen, and to an auto-generated logfile.
This can be handy for building a version of code to hand to customers with an irreproducible bug to get a detailed report of what happened. Its also handy for embedded or timing sensative programs where capturing the log of exactly what happened is helpful.
#define qStroika_Foundation_Debug_ShowThreadIndex 1 |
if true, emit a much shorter thread ID, making - I suspect (testing) for terser and clearer tracelogs. Only downside is that you must find first occurrence of that index to find real threadId, and use that in waits, etc.
This is defined as a #define, so you can turn it off when building Stroika. I'm unsure if the showing of thread indexes helps readability of the tracelog, but I think it does.
This is somewhat helpful on windows, but much more so on 64-bit linux with very long fairly random looking thread ids.
#define Stroika_Foundation_Debug_OptionalizeTraceArgs | ( | ... | ) |
This is meant to be used with the 2+ argument Debug::TraceContextBumper constructor (_f format string), to optionally suppress side-effects of trace arguments when tracing is disabled (at compile time).
#define DbgTrace _NoOp_ |
This function either does NOTHING (trying to not even evaluate its arguments) or does a printf style PRINT function by delegating to @'EmitTraceMessage'. Which of these two behaviors you see is conditioned on @'qStroika_Foundation_Debug_DefaultTracingOn'
template <typename CHAR_T, typename... Args> nonvirtual void DbgTrace (Characters::FormatString<CHAR_T> fmt, Args&&... args) noexcept { or some such try { Stroika::Foundation::Debug::Private_::Emitter::Get ().EmitTraceMessage (fmt.get (), Common::StdCompat::make_wformat_args (args...)); } catch (...) { } } but only after 'd' stage development so I can lose C-style FMT string overloads...