diff --git a/src/libraries/JANA/CMakeLists.txt b/src/libraries/JANA/CMakeLists.txt index 1ca7a8800..ffb7ea743 100644 --- a/src/libraries/JANA/CMakeLists.txt +++ b/src/libraries/JANA/CMakeLists.txt @@ -22,7 +22,6 @@ set(JANA2_SOURCES Topology/JTopologyBuilder.cc Services/JComponentManager.cc - Services/JLoggingService.cc Services/JParameterManager.cc Services/JPluginLoader.cc Services/JWiringService.cc diff --git a/src/libraries/JANA/Services/JLoggingService.cc b/src/libraries/JANA/Services/JLoggingService.cc deleted file mode 100644 index dd8382e38..000000000 --- a/src/libraries/JANA/Services/JLoggingService.cc +++ /dev/null @@ -1,88 +0,0 @@ - -// Copyright 2020, Jefferson Science Associates, LLC. -// Subject to the terms in the LICENSE file found in the top-level directory. - - -#include - - - - -void JLoggingService::acquire_services(JServiceLocator* serviceLocator) { - - auto params = serviceLocator->get(); - params->SetDefaultParameter("log:global", m_global_log_level, "Default log level"); - - std::vector groups; - params->SetDefaultParameter("log:off", groups, "Comma-separated list of loggers that should be turned off completely"); - for (auto& s : groups) { - m_local_log_levels[s] = JLogger::Level::OFF; - } - groups.clear(); - params->SetDefaultParameter("log:fatal", groups, "Comma-separated list of loggers that should only print FATAL"); - for (auto& s : groups) { - m_local_log_levels[s] = JLogger::Level::FATAL; - } - groups.clear(); - params->SetDefaultParameter("log:error", groups, "Comma-separated list of loggers that should only print ERROR or higher"); - for (auto& s : groups) { - m_local_log_levels[s] = JLogger::Level::ERROR; - } - groups.clear(); - params->SetDefaultParameter("log:warn", groups, "Comma-separated list of loggers that should only print WARN or higher"); - for (auto& s : groups) { - m_local_log_levels[s] = JLogger::Level::WARN; - } - groups.clear(); - params->SetDefaultParameter("log:info", groups, "Comma-separated list of loggers that should only print INFO or higher"); - for (auto& s : groups) { - m_local_log_levels[s] = JLogger::Level::INFO; - } - groups.clear(); - params->SetDefaultParameter("log:debug", groups, "Comma-separated list of loggers that should only print DEBUG or higher"); - for (auto& s : groups) { - m_local_log_levels[s] = JLogger::Level::DEBUG; - } - groups.clear(); - params->SetDefaultParameter("log:trace", groups, "Comma-separated list of loggers that should print everything"); - for (auto& s : groups) { - m_local_log_levels[s] = JLogger::Level::TRACE; - } - // Set the log level on the parameter manager, resolving the chicken-and-egg problem. - params->SetLogger(get_logger("JParameterManager")); -} - - -void JLoggingService::set_level(JLogger::Level level) { - m_global_log_level = level; -} - - -void JLoggingService::set_level(std::string className, JLogger::Level level) { - m_local_log_levels[className] = level; -} - - -JLogger JLoggingService::get_logger() { - return JLogger(m_global_log_level); -} - - -JLogger JLoggingService::get_logger(std::string className) { - - JLogger logger; - logger.show_classname = true; - logger.className = className; - - auto search = m_local_log_levels.find(className); - if (search != m_local_log_levels.end()) { - logger.level = search->second; - } else { - logger.level = m_global_log_level; - } - return logger; -} - - - - diff --git a/src/libraries/JANA/Services/JLoggingService.h b/src/libraries/JANA/Services/JLoggingService.h deleted file mode 100644 index 692d5b890..000000000 --- a/src/libraries/JANA/Services/JLoggingService.h +++ /dev/null @@ -1,48 +0,0 @@ - -// Copyright 2020, Jefferson Science Associates, LLC. -// Subject to the terms in the LICENSE file found in the top-level directory. - -#pragma once - -#include -#include -#include - - -// Convenience macros for temporary debugging statements. -#ifndef _DBG__ -#define _DBG__ std::cerr<<__FILE__<<":"<<__LINE__< m_local_log_levels; - -public: - - void acquire_services(JServiceLocator* serviceLocator) override; - - void set_level(JLogger::Level level); - - void set_level(std::string className, JLogger::Level level); - - JLogger get_logger(); - - JLogger get_logger(std::string className); - -}; - - -