nx_metadata_sdk 1.0 Metadata SDK

output_redirector.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <string>
6
7 #if !defined(NX_KIT_API)
8 #define NX_KIT_API
9 #endif
10
11 namespace nx {
12 namespace kit {
13
40 class NX_KIT_API OutputRedirector
41 {
42 public:
43 OutputRedirector(const OutputRedirector&) = delete;
44
45 void operator=(const OutputRedirector&) = delete;
46
47 static const OutputRedirector& getInstance();
48
65 static void ensureOutputRedirection();
66
67 protected: //< Intended for unit tests.
68 OutputRedirector();
69
70 static void redirectStdoutAndStderrIfNeeded(const char* overridingLogFilesDir = nullptr);
71 };
72
73 } // namespace kit
74 } // namespace nx
nx
Definition: apple_utils.h:6
nx::kit::OutputRedirector
Definition: output_redirector.h:40