mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 01:30:25 +08:00
23 lines
329 B
Go
23 lines
329 B
Go
|
package logx
|
||
|
|
||
|
import "log"
|
||
|
|
||
|
type logWriter struct {
|
||
|
logger *log.Logger
|
||
|
}
|
||
|
|
||
|
func newLogWriter(logger *log.Logger) logWriter {
|
||
|
return logWriter{
|
||
|
logger: logger,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (lw logWriter) Close() error {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (lw logWriter) Write(data []byte) (int, error) {
|
||
|
lw.logger.Print(string(data))
|
||
|
return len(data), nil
|
||
|
}
|