nx_metadata_sdk 1.0 Metadata SDK

log_utils.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 <map>
6 #include <string>
7
8 namespace nx::sdk {
9
10 class IStringMap;
11
27 struct LogUtils
28 {
29 const bool enableOutput;
30 std::string printPrefix;
31
32 LogUtils(bool enableOutput, std::string printPrefix):
33 enableOutput(enableOutput), printPrefix(std::move(printPrefix))
34 {
35 }
36
37 void setPrintPrefix(std::string newPrefix);
38
45 bool convertAndOutputStringMap(
46 std::map<std::string, std::string>* outMap,
47 const IStringMap* stringMap,
48 const std::string& caption,
49 int outputIndent = 0) const;
50 };
51
52 } // namespace nx::sdk
nx::sdk::IStringMap
Definition: i_string_map.h:9
nx::sdk::LogUtils::convertAndOutputStringMap
bool convertAndOutputStringMap(std::map< std::string, std::string > *outMap, const IStringMap *stringMap, const std::string &caption, int outputIndent=0) const
Definition: log_utils.cpp:20
nx::sdk
Definition: device_agent.h:12
nx::sdk::LogUtils
Definition: log_utils.h:27