|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
Global registry for log categories with runtime verbosity control. More...
#include <LogCategory.h>
Public Member Functions | |
| void | registerCategory (LogCategory *category) |
| Register a category (called automatically by DEFINE_LOG_CATEGORY) | |
| LogCategory * | findCategory (const std::string &name) |
| Find a category by name. | |
| bool | setVerbosity (const std::string &categoryName, LogVerbosity verbosity) |
| void | setAllVerbosity (LogVerbosity verbosity) |
| Set verbosity for all categories. | |
| std::vector< LogCategory * > | getAllCategories () const |
| Get all registered categories (for debug UI, listing, etc.) | |
| bool | loadConfig (const std::string &configPath) |
| Load verbosity settings from a JSON config file. | |
| bool | saveConfig (const std::string &configPath) const |
| Save current verbosity settings to a JSON config file. | |
Static Public Member Functions | |
| static LogCategoryManager & | get () |
| Get the singleton instance. | |
Private Member Functions | |
| LogCategoryManager ()=default | |
| ~LogCategoryManager ()=default | |
| LogCategoryManager (const LogCategoryManager &)=delete | |
| LogCategoryManager & | operator= (const LogCategoryManager &)=delete |
Private Attributes | |
| std::mutex | mutex_ |
| std::unordered_map< std::string, LogCategory * > | categories_ |
| LogVerbosity | defaultVerbosity_ = LogVerbosity::Info |
Global registry for log categories with runtime verbosity control.
Thread-safe singleton that manages all log categories.
Definition at line 132 of file LogCategory.h.
|
privatedefault |
Referenced by get(), LogCategoryManager(), and operator=().
|
privatedefault |
|
privatedelete |
|
nodiscard |
Find a category by name.
Definition at line 69 of file LogCategory.cpp.
References categories_, and mutex_.
|
static |
Get the singleton instance.
Definition at line 57 of file LogCategory.cpp.
References LogCategoryManager().
Referenced by EngineCore::LogCategory::LogCategory().
|
nodiscard |
Get all registered categories (for debug UI, listing, etc.)
Definition at line 96 of file LogCategory.cpp.
References categories_, and mutex_.
| bool EngineCore::LogCategoryManager::loadConfig | ( | const std::string & | configPath | ) |
Load verbosity settings from a JSON config file.
Expected format: { "LogCategories": { "LogLOD": "Verbose", "LogRenderer": "Info", "Default": "Warning" } }
| configPath | Path to the JSON config file |
Definition at line 107 of file LogCategory.cpp.
References categories_, defaultVerbosity_, mutex_, and EngineCore::verbosityFromString().
|
privatedelete |
| void EngineCore::LogCategoryManager::registerCategory | ( | LogCategory * | category | ) |
Register a category (called automatically by DEFINE_LOG_CATEGORY)
Definition at line 63 of file LogCategory.cpp.
References categories_, EngineCore::LogCategory::getName(), and mutex_.
Referenced by EngineCore::LogCategory::LogCategory().
| bool EngineCore::LogCategoryManager::saveConfig | ( | const std::string & | configPath | ) | const |
Save current verbosity settings to a JSON config file.
| configPath | Path to save the config |
Definition at line 156 of file LogCategory.cpp.
References categories_, defaultVerbosity_, mutex_, and EngineCore::verbosityToString().
| void EngineCore::LogCategoryManager::setAllVerbosity | ( | LogVerbosity | verbosity | ) |
Set verbosity for all categories.
Definition at line 87 of file LogCategory.cpp.
References categories_, defaultVerbosity_, and mutex_.
| bool EngineCore::LogCategoryManager::setVerbosity | ( | const std::string & | categoryName, |
| LogVerbosity | verbosity ) |
Set verbosity for a specific category
Definition at line 76 of file LogCategory.cpp.
References categories_, and mutex_.
|
private |
Definition at line 187 of file LogCategory.h.
Referenced by findCategory(), getAllCategories(), loadConfig(), registerCategory(), saveConfig(), setAllVerbosity(), and setVerbosity().
|
private |
Definition at line 188 of file LogCategory.h.
Referenced by loadConfig(), saveConfig(), and setAllVerbosity().
|
mutableprivate |
Definition at line 186 of file LogCategory.h.
Referenced by findCategory(), getAllCategories(), loadConfig(), registerCategory(), saveConfig(), setAllVerbosity(), and setVerbosity().