mirror of
https://gitee.com/johng/gf
synced 2026-07-04 13:02:36 +08:00
change parameter to unnecssary for glog.Header/Stdout; version updates
This commit is contained in:
@ -48,14 +48,16 @@ func Backtrace(enabled bool, skip...int) *Logger {
|
||||
|
||||
// StdPrint is a chaining function,
|
||||
// which enables/disables stdout for the current logging content output.
|
||||
func Stdout(enabled bool) *Logger {
|
||||
return logger.Stdout(enabled)
|
||||
// It's enabled in default.
|
||||
func Stdout(enabled...bool) *Logger {
|
||||
return logger.Stdout(enabled...)
|
||||
}
|
||||
|
||||
// Header is a chaining function,
|
||||
// which enables/disables log header for the current logging content output.
|
||||
func Header(enabled bool) *Logger {
|
||||
return logger.Header(enabled)
|
||||
// It's enabled in default.
|
||||
func Header(enabled...bool) *Logger {
|
||||
return logger.Header(enabled...)
|
||||
}
|
||||
|
||||
// Line is a chaining function,
|
||||
|
||||
@ -99,33 +99,43 @@ func (l *Logger) Backtrace(enabled bool, skip...int) *Logger {
|
||||
|
||||
// Stdout is a chaining function,
|
||||
// which enables/disables stdout for the current logging content output.
|
||||
func (l *Logger) Stdout(enabled bool) *Logger {
|
||||
// It's enabled in default.
|
||||
func (l *Logger) Stdout(enabled...bool) *Logger {
|
||||
logger := (*Logger)(nil)
|
||||
if l.parent == nil {
|
||||
logger = l.Clone()
|
||||
} else {
|
||||
logger = l
|
||||
}
|
||||
logger.stdoutPrint = enabled
|
||||
if len(enabled) > 0 && enabled[0] {
|
||||
logger.stdoutPrint = true
|
||||
} else {
|
||||
logger.stdoutPrint = false
|
||||
}
|
||||
return logger
|
||||
}
|
||||
|
||||
// See Stdout.
|
||||
// Deprecated.
|
||||
func (l *Logger) StdPrint(enabled bool) *Logger {
|
||||
return l.Stdout(enabled)
|
||||
func (l *Logger) StdPrint(enabled...bool) *Logger {
|
||||
return l.Stdout(enabled...)
|
||||
}
|
||||
|
||||
// Header is a chaining function,
|
||||
// which enables/disables log header for the current logging content output.
|
||||
func (l *Logger) Header(enabled bool) *Logger {
|
||||
// It's enabled in default.
|
||||
func (l *Logger) Header(enabled...bool) *Logger {
|
||||
logger := (*Logger)(nil)
|
||||
if l.parent == nil {
|
||||
logger = l.Clone()
|
||||
} else {
|
||||
logger = l
|
||||
}
|
||||
logger.SetHeaderPrint(enabled)
|
||||
if len(enabled) > 0 && enabled[0] {
|
||||
logger.SetHeaderPrint(true)
|
||||
} else {
|
||||
logger.SetHeaderPrint(false)
|
||||
}
|
||||
return logger
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package gf
|
||||
|
||||
const VERSION = "v1.6.13"
|
||||
const VERSION = "v1.6.14"
|
||||
const AUTHORS = "john<john@goframe.org>"
|
||||
|
||||
Reference in New Issue
Block a user