Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe what this PR does / why we need it
Add fundamental logger mechanism
Does this pull request fix one issue?
#16
Describe how you did it
需求
目前 OpenSergo 控制面的日志机制非常简单,复用了 Sentinel Go 的日志模块。我们需要设计一个通用的 logger 机制与基本实现,并支持任意扩展。
功能分析
概要设计
基于zap封装,达到高性能(更少的内存分配及非sugar log 未使用反射)
定义日志选项
创建全局logger及各级别打印方法
写入到支持的输出设备中
参考
https://pkg.go.dev/golang.org/x/exp/slog
https://github.com/uber-go/zap
https://github.com/golang/glog
https://github.com/istio/klog
https://github.com/go-logr/logr
https://github.com/go-kratos/kratos
https://github.com/zeromicro/go-zero
Describe how to verify it
reference unit test
Special notes for reviews