directory restructure and documentation cleanup

This commit is contained in:
Chris Punches
2025-03-08 04:56:07 -05:00
parent 34bab86b69
commit f0859c93c3
19 changed files with 1180 additions and 271 deletions

View File

@@ -33,20 +33,87 @@
#include <string>
#include "LoggingLevels.hpp"
// default system configuration
/**
* @struct DPMDefaults
* @brief Default configuration values for DPM
*
* Provides system-wide default values for paths, logging settings, and
* other configuration options used when explicit configuration is not provided.
*/
struct DPMDefaults {
/**
* @brief Default path to the directory containing DPM modules
*
* Directory where DPM looks for module shared objects (.so files)
* when no explicit module path is provided.
*/
static const char* const MODULE_PATH;
/**
* @brief Default path to the directory containing configuration files
*
* Directory where DPM looks for configuration files (.conf files)
* when no explicit configuration directory is provided.
*/
static const char* const CONFIG_DIR;
/**
* @brief Default path to the log file
*
* File where DPM writes log messages when logging to file is enabled
* and no explicit log file path is provided.
*/
static const char* const LOG_FILE;
/**
* @brief Default setting for whether to write to log file
*
* Determines whether DPM writes log messages to a file by default.
*/
static const bool write_to_log;
/**
* @brief Default log level
*
* Determines which log messages are recorded based on their severity.
* Messages with a level less than or equal to this value are logged.
*/
static const LoggingLevels LOG_LEVEL;
};
// Initialize static constants
/**
* @brief Default module path initialization
*
* Sets the default module path to the standard system location.
*/
inline const char * const DPMDefaults::MODULE_PATH = "/usr/lib/dpm/modules/";
/**
* @brief Default configuration directory initialization
*
* Sets the default configuration directory to the standard system location.
*/
inline const char * const DPMDefaults::CONFIG_DIR = "/etc/dpm/conf.d/";
/**
* @brief Default log file path initialization
*
* Sets the default log file path to the standard system location.
*/
inline const char * const DPMDefaults::LOG_FILE = "/var/log/dpm.log";
/**
* @brief Default write to log setting initialization
*
* By default, logging to file is disabled.
*/
inline const bool DPMDefaults::write_to_log = false;
/**
* @brief Default log level initialization
*
* By default, only messages with level INFO or lower (FATAL, ERROR, WARN, INFO)
* are logged, while DEBUG messages are not.
*/
inline const LoggingLevels DPMDefaults::LOG_LEVEL = LoggingLevels::INFO;