From 4df0770ffe6fb03ed7b5248a7fadef935d856ad3 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Thu, 28 Oct 2021 11:33:47 +0200 Subject: Initial integration of Trace from UE5 via the --zentrace=y xmake config --- zencore/trace.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 zencore/trace.cpp (limited to 'zencore/trace.cpp') diff --git a/zencore/trace.cpp b/zencore/trace.cpp new file mode 100644 index 000000000..3042c80c8 --- /dev/null +++ b/zencore/trace.cpp @@ -0,0 +1,32 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#if ZEN_WITH_TRACE + +#include + +#define TRACE_IMPLEMENT 1 +#include +//#undef TRACE_IMPLEMENT + +void TraceInit(const char* HostOrPath, TraceType Type) +{ + switch (Type) + { + case TraceType::Network: + trace::SendTo(HostOrPath); + break; + + case TraceType::File: + trace::WriteTo(HostOrPath); + break; + } + + trace::FInitializeDesc Desc = { + .bUseImportantCache = false, + }; + trace::Initialize(Desc); + + trace::ToggleChannel("cpu", true); +} + +#endif // ZEN_WITH_TRACE -- cgit v1.2.3