feat: Add log category filtering for enhanced logging control

- Introduced a new command-line flag for specifying log categories, allowing users to filter logs based on selected categories.
- Implemented parsing of the comma-separated log categories string in the main application.
- Enhanced the LogManager to support category-specific logging and added console output to indicate which categories are enabled for debugging.
This commit is contained in:
scawful
2025-10-09 22:50:45 -04:00
parent 81ef43f2e4
commit d371dbc2d7
2 changed files with 28 additions and 1 deletions

View File

@@ -50,6 +50,14 @@ void LogManager::configure(LogLevel level, const std::string& file_path,
} else {
all_categories_enabled_.store(false);
enabled_categories_ = categories;
// Log which categories are enabled for debugging
std::string category_list;
for (const auto& cat : categories) {
if (!category_list.empty()) category_list += ", ";
category_list += cat;
}
std::cerr << "Log categories filter enabled: [" << category_list << "]" << std::endl;
}
// If a file path is provided, close any existing stream and open the new file.