nx_cloud_storage_sdk
1.0
Cloud Storage SDK
|
#include <log_utils.h>
Public Member Functions | |
LogUtils (bool enableOutput, std::string printPrefix) | |
void | setPrintPrefix (std::string newPrefix) |
bool | convertAndOutputStringMap (std::map< std::string, std::string > *outMap, const IStringMap *stringMap, const std::string &caption, int outputIndent=0) const |
Public Attributes | |
const bool | enableOutput |
std::string | printPrefix |
Plugin utils providing convenience for using NX_PRINT/NX_OUTPUT with their settings (printPrefix string and enableOutput flag) taken from the particular plugin: these settings are stored in this class.
To use this tool in a class, make a field "const nx::sdk::LogUtils logUtils", and add the following lines:
#define NX_PRINT_PREFIX (this->logUtils.printPrefix)
#define NX_DEBUG_ENABLE_OUTPUT (this->logUtils.enableOutput)
#include <nx/kit/debug.h>
bool nx::sdk::LogUtils::convertAndOutputStringMap | ( | std::map< std::string, std::string > * | outMap, |
const IStringMap * | stringMap, | ||
const std::string & | caption, | ||
int | outputIndent = 0 |
||
) | const |
Convert IStringMap to an std::map and log via NX_OUTPUT. Errors are printed with NX_PRINT.
caption | To be printed before the map and errors; will be followed by ":". |
outputIndent | Number of spaces to be printed before each line printed with NX_OUTPUT. |