Add console logger for nscp_api debug mode

This commit is contained in:
Michael Friedrich 2018-06-19 12:46:10 +02:00
parent b3970d4b74
commit d9a55ac064
1 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,7 @@
#include "base/application.hpp"
#include "base/json.hpp"
#include "base/string.hpp"
#include "base/logger.hpp"
#include "base/exception.hpp"
#include <boost/program_options.hpp>
#include <boost/algorithm/string/split.hpp>
@ -284,6 +285,12 @@ int main(int argc, char **argv)
l_Debug = vm.count("debug") > 0;
// Initialize logger
if (l_Debug)
Logger::SetConsoleLogSeverity(LogDebug);
else
Logger::SetConsoleLogSeverity(LogWarning);
// Create the URL string and escape certain characters since Url() follows RFC 3986
String endpoint = "/query/" + vm["query"].as<std::string>();
if (!vm.count("arguments"))