aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/nanotrace/tracefile.cpp
blob: ba6ff09512f6b2b7b65b2fc8f9db28f69151579f (plain)
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
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "tracefile.h"

#include "nanotracehr.h"

namespace NanotraceHR {

#ifdef ENABLE_TRACING_FILE

static std::unique_ptr<EnabledTraceFile> &getTraceFile()
{
    static auto traceFile = std::make_unique<EnabledTraceFile>("tracing.json");

    return traceFile;
}

EnabledTraceFile &traceFile()
{
    return *getTraceFile().get();
}

void resetTraceFilePointer()
{
    getTraceFile().reset();
}

#endif

} // namespace NanotraceHR