aboutsummaryrefslogtreecommitdiff
path: root/zencore/trace.cpp
blob: 788dcec07249d9e8732e87caddcd0e53556dd50f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright Epic Games, Inc. All Rights Reserved.

/* clang-format off */

#if ZEN_WITH_TRACE

#include <zencore/zencore.h>

#define TRACE_IMPLEMENT 1
#include <zencore/trace.h>

void
TraceInit(const char* HostOrPath, TraceType Type)
{
	bool EnableEvents = true;

	switch (Type)
	{
		case TraceType::Network:
			trace::SendTo(HostOrPath);
			break;

		case TraceType::File:
			trace::WriteTo(HostOrPath);
			break;

		case TraceType::None:
			EnableEvents = false;
			break;
	}

	trace::FInitializeDesc Desc = {
		.bUseImportantCache = false,
	};
	trace::Initialize(Desc);

	if (EnableEvents)
	{
		trace::ToggleChannel("cpu", true);
	}
}

#endif	// ZEN_WITH_TRACE

/* clang-format on */