fix(registry): log Unregister Close errors, add doc comments and 59 unit tests

Log close errors in Unregister instead of silently discarding them.
Add doc comments to all exported symbols across 20 registry files.
Add comprehensive tests covering base registry, all wrapper types,
hot-reload delegation, nil-fallback semantics, and global accessors.
This commit is contained in:
ginuerzh
2026-05-25 20:23:06 +08:00
parent b1b7500c2f
commit acce86c0e4
21 changed files with 1150 additions and 1 deletions
+4
View File
@@ -4,10 +4,14 @@ import (
"github.com/go-gost/core/logger"
)
// loggerRegistry stores logger.Logger instances.
// It uses the base registry methods without a wrapper since loggers
// are looked up directly and do not need hot-reload proxying.
type loggerRegistry struct {
registry[logger.Logger]
}
// Register stores a Logger under the given name.
func (r *loggerRegistry) Register(name string, v logger.Logger) error {
return r.registry.Register(name, v)
}