Summary
Implement GlobalLoggerRegistry, the core component of the runtime binding pattern.
Background
The current mutual dependency between thread_system and logger_system causes issues:
logger_system → thread_system (for async processing)
thread_system → defines its own logger_interface.h (to avoid circular dependency)
This structure creates maintenance and extensibility problems.
Tasks
1. Implement GlobalLoggerRegistry Class
2. Interface Definition
class GlobalLoggerRegistry final : public interfaces::ILoggerRegistry {
public:
static GlobalLoggerRegistry& instance();
void set_default(std::shared_ptr<ILogger> logger) override;
std::shared_ptr<ILogger> get_default() const override;
void register_logger(std::string_view name, std::shared_ptr<ILogger> logger) override;
std::shared_ptr<ILogger> get_logger(std::string_view name) const override;
void unregister_logger(std::string_view name) override;
void register_factory(std::string_view name, LoggerFactory factory) override;
};
3. Provide Convenience Functions
4. NullLogger Default Implementation
Test Requirements
Impact Scope
- All subsystems will use this Registry
- Replaces existing
thread_system::logger_registry
Related Milestone
- Phase 1: common_system interface extension
- Priority: Critical
- Blocks: All of Phase 2 and Phase 3
Summary
Implement GlobalLoggerRegistry, the core component of the runtime binding pattern.
Background
The current mutual dependency between
thread_systemandlogger_systemcauses issues:logger_system→thread_system(for async processing)thread_system→ defines its ownlogger_interface.h(to avoid circular dependency)This structure creates maintenance and extensibility problems.
Tasks
1. Implement GlobalLoggerRegistry Class
include/kcenon/common/logging/global_registry.hstd::shared_mutex2. Interface Definition
3. Provide Convenience Functions
get_registry()- Return Registry instanceget_logger()- Return default loggerget_logger(name)- Return named logger4. NullLogger Default Implementation
Test Requirements
Impact Scope
thread_system::logger_registryRelated Milestone