2019-04-17 23:50:37 +08:00
|
|
|
// Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
|
|
|
|
//
|
|
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
|
|
// If a copy of the MIT was not distributed with this file,
|
|
|
|
// You can obtain one at https://github.com/gogf/gf.
|
|
|
|
|
|
|
|
package glog
|
|
|
|
|
2019-06-13 19:29:09 +08:00
|
|
|
import "bytes"
|
|
|
|
|
2019-04-17 23:50:37 +08:00
|
|
|
// Write implements the io.Writer interface.
|
2019-05-23 20:34:06 +08:00
|
|
|
// It just prints the content using Print.
|
|
|
|
func (l *Logger) Write(p []byte) (n int, err error) {
|
2019-06-13 19:29:09 +08:00
|
|
|
l.Header(false).Print(string(bytes.TrimRight(p, "\r\n")))
|
2019-04-17 23:50:37 +08:00
|
|
|
return len(p), nil
|
2019-06-19 09:06:52 +08:00
|
|
|
}
|