mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 01:30:25 +08:00
16 lines
262 B
Go
16 lines
262 B
Go
|
package logx
|
||
|
|
||
|
import "log"
|
||
|
|
||
|
type redirector struct{}
|
||
|
|
||
|
// CollectSysLog redirects system log into logx info
|
||
|
func CollectSysLog() {
|
||
|
log.SetOutput(new(redirector))
|
||
|
}
|
||
|
|
||
|
func (r *redirector) Write(p []byte) (n int, err error) {
|
||
|
Info(string(p))
|
||
|
return len(p), nil
|
||
|
}
|