vllm-project / vllm-project/aibrix
Build better logging experiences with zap/klogr and structure logging
- Dominant language
- Go
- Stars
- 5.1k
- Forks
- 694
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 98
Description
### 🚀 Feature Description and Motivation
- Option 1: zap (native solution), good for structure logging
- Option 2: klogr + klog - most simplest solution with minimum changes
no need to change the klog reference in the controller codes, append `--v=4` will show the debug level messages.
```
klog.InitFlags(flag.CommandLine)
defer klog.Flush()
flag.Parse()
ctrl.SetLogger(klogr.New())
```
- Option 3: klogr textlogger
```
logConfig := textlogger.NewConfig(
textlogger.Verbosity(4),
textlogger.Output(os.Stdout))
ctrl.SetLogger(textlogger.NewLogger(logConfig))
```
in this case, `textlogger.Verbosity(4)` won't show klog.V(4), there're still separate. We should use `ctrl.Log.V(4).Info`
### Use Case
_No response_
### Proposed Solution
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.