refactor(liblogging): changed SERiF to use liblogging

This commit is contained in:
2025-06-21 08:26:04 -04:00
parent a43f327672
commit c55185c1e3
20 changed files with 56 additions and 226 deletions

View File

@@ -22,12 +22,10 @@
#pragma once
#include <string>
#include <map>
#include <vector>
#include <utility>
#include "mfem.hpp"
#include "quill/Logger.h"
/**
* @brief The Probe namespace contains utility functions for debugging and logging.
@@ -57,7 +55,7 @@ namespace serif::probe {
/**
* @brief Visualize a vector using GLVis.
* @param vec The vector to visualize.
* @param mesh The mesh associated with the vector.
* @param fes The mesh associated with the vector.
* @param windowTitle The title of the visualization window.
* @param keyset The keyset to use for visualization.
*/
@@ -73,65 +71,4 @@ namespace serif::probe {
const std::vector<double>& rayDirection, int numSamples, std::string filename="");
/**
* @brief Class to manage logging operations.
*/
class LogManager {
private:
/**
* @brief Private constructor for singleton pattern.
*/
LogManager();
/**
* @brief Destructor.
*/
~LogManager();
// Map to store pointers to quill loggers (raw pointers as quill deals with its own memory managment in a seperated, detatched, thread)
std::map<std::string, quill::Logger*> loggerMap;
// Prevent copying and assignment (Rule of Zero)
LogManager(const LogManager&) = delete;
LogManager& operator=(const LogManager&) = delete;
public:
/**
* @brief Get the singleton instance of LogManager.
* @return The singleton instance of LogManager.
*/
static LogManager& getInstance() {
static LogManager instance;
return instance;
}
/**
* @brief Get a logger by name.
* @param loggerName The name of the logger.
* @return A pointer to the logger.
*/
quill::Logger* getLogger(const std::string& loggerName);
/**
* @brief Get the names of all loggers.
* @return A vector of logger names.
*/
std::vector<std::string> getLoggerNames();
/**
* @brief Get all loggers.
* @return A vector of pointers to the loggers.
*/
std::vector<quill::Logger*> getLoggers();
/**
* @brief Create a new file logger.
* @param filename The name of the log file.
* @param loggerName The name of the logger.
* @return A pointer to the new logger.
*/
quill::Logger* newFileLogger(const std::string& filename,
const std::string& loggerName);
};
} // namespace Probe