mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
update lead string position for glog
This commit is contained in:
@ -243,6 +243,13 @@ func (l *Logger) print(std io.Writer, lead string, value...interface{}) {
|
||||
if len(timeFormat) > 0 {
|
||||
buffer.WriteString(time.Now().Format(timeFormat))
|
||||
}
|
||||
// Lead string.
|
||||
if len(lead) > 0 {
|
||||
buffer.WriteString(lead)
|
||||
if len(value) > 0 {
|
||||
buffer.WriteByte(' ')
|
||||
}
|
||||
}
|
||||
// Caller path.
|
||||
callerPath := ""
|
||||
if l.flags & F_FILE_LONG > 0 {
|
||||
@ -259,12 +266,6 @@ func (l *Logger) print(std io.Writer, lead string, value...interface{}) {
|
||||
buffer.WriteString(l.prefix + " ")
|
||||
}
|
||||
}
|
||||
if len(lead) > 0 {
|
||||
buffer.WriteString(lead)
|
||||
if len(value) > 0 {
|
||||
buffer.WriteByte(' ')
|
||||
}
|
||||
}
|
||||
for k, v := range value {
|
||||
if k > 0 {
|
||||
buffer.WriteByte(' ')
|
||||
|
||||
@ -5,6 +5,6 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
glog.Line().Println("this is the short file name with its line number")
|
||||
glog.Line(true).Println("lone file name with line number")
|
||||
glog.Line().Debug("this is the short file name with its line number")
|
||||
glog.Line(true).Debug("lone file name with line number")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user