Commit ebfba13e authored by Jesse Mapel's avatar Jesse Mapel
Browse files

Added std out and error logging

parent aa9b736d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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 {
+12 −1
Original line number Diff line number Diff line
@@ -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);
      }