github.com/wangyougui/gf/v2@v2.6.5/os/glog/glog_logger_writer.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/wangyougui/gf.
     6  
     7  package glog
     8  
     9  import (
    10  	"bytes"
    11  	"context"
    12  )
    13  
    14  // Write implements the io.Writer interface.
    15  // It just prints the content using Print.
    16  func (l *Logger) Write(p []byte) (n int, err error) {
    17  	l.Header(false).Print(context.TODO(), string(bytes.TrimRight(p, "\r\n")))
    18  	return len(p), nil
    19  }