Refactored agents

This commit is contained in:
James P. Howard, II
2020-12-23 16:47:27 -05:00
parent 4a8947b62d
commit fcc177db7c
7 changed files with 59 additions and 65 deletions

View File

@@ -2,14 +2,14 @@
* TODO FILEHEADER
*/
#include <kami/agent.h>
#include <kami/config.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
#include <CLI/App.hpp>
#include <CLI/Config.hpp>
#include <CLI/Formatter.hpp>
#include <kami/agent.h>
#include <kami/config.h>
#include <string>
using namespace kami;
@@ -21,12 +21,15 @@ int main(int argc, char **argv) {
auto console = spdlog::stdout_color_st(ident);
string logLevelOption = "info";
app.add_option("-l", logLevelOption, "Set the logging level")->check(CLI::IsMember(SPDLOG_LEVEL_NAMES));
app.add_option("-l", logLevelOption, "Set the logging level")
->check(CLI::IsMember(SPDLOG_LEVEL_NAMES));
CLI11_PARSE(app, argc, argv);
console->set_level(spdlog::level::from_str(logLevelOption));
console->info("Compiled with Kami/{}, log level {}", KAMI_VERSION_STRING, logLevelOption);
console->info("Compiled with Kami/{}, log level {}", KAMI_VERSION_STRING,
logLevelOption);
Agent testAgent;
console->debug("Successfully created Agent with ID {}", testAgent.getAgentID().toString());
console->debug("Successfully created Agent with ID {}",
testAgent.getAgentID().toString());
}

View File

@@ -2,14 +2,14 @@
* TODO FILEHEADER
*/
#include <kami/agent.h>
#include <kami/config.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
#include <CLI/App.hpp>
#include <CLI/Config.hpp>
#include <CLI/Formatter.hpp>
#include <kami/agent.h>
#include <kami/config.h>
#include <string>
using namespace kami;
@@ -21,12 +21,15 @@ int main(int argc, char **argv) {
auto console = spdlog::stdout_color_st(ident);
string logLevelOption = "info";
app.add_option("-l", logLevelOption, "Set the logging level")->check(CLI::IsMember(SPDLOG_LEVEL_NAMES));
app.add_option("-l", logLevelOption, "Set the logging level")
->check(CLI::IsMember(SPDLOG_LEVEL_NAMES));
CLI11_PARSE(app, argc, argv);
console->set_level(spdlog::level::from_str(logLevelOption));
console->info("Compiled with Kami/{}, log level {}", KAMI_VERSION_STRING, logLevelOption);
console->info("Compiled with Kami/{}, log level {}", KAMI_VERSION_STRING,
logLevelOption);
AgentID testAgentID;
console->debug("Successfully created AgentID with ID {}", testAgentID.toString());
console->debug("Successfully created AgentID with ID {}",
testAgentID.to_string());
}