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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user