Skip to content
Snippets Groups Projects
Commit ebfba13e authored by Jesse Mapel's avatar Jesse Mapel
Browse files

Added std out and error logging

parent aa9b736d
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,6 @@
#include <Version.h>
#include <nlohmann/json.hpp>
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/spdlog.h"
class UsgsAstroPlugin : public csm::Plugin {
......
......@@ -16,6 +16,9 @@
#include <csm.h>
#include <math.h>
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/stdout_color_sinks.h"
#include <nlohmann/json.hpp>
using json = nlohmann::json;
......@@ -49,7 +52,15 @@ UsgsAstroPlugin::UsgsAstroPlugin() {
if (logFile != "") {
std::shared_ptr<spdlog::logger> m_logger = spdlog::get("usgscsm_logger");
if (!m_logger) {
if (logFile == "stdout") {
std::shared_ptr<spdlog::logger> m_logger =
spdlog::stdout_color_mt("usgscsm_logger");
}
else if (logFile == "stderr") {
std::shared_ptr<spdlog::logger> m_logger =
spdlog::stderr_color_mt("usgscsm_logger");
}
else if (!m_logger) {
std::shared_ptr<spdlog::logger> m_logger =
spdlog::basic_logger_mt("usgscsm_logger", logFile);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment