mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
fix(net/goai): change default value of RequestBody.Required from true to false, add required tag support for RequestBody (#3796)
This commit is contained in:
@ -355,11 +355,19 @@ func (l *Logger) getFpFromPool(ctx context.Context, path string) *gfpool.File {
|
||||
|
||||
// printStd prints content `s` without stack.
|
||||
func (l *Logger) printStd(ctx context.Context, level int, values ...interface{}) {
|
||||
// nil logger, print nothing
|
||||
if l == nil {
|
||||
return
|
||||
}
|
||||
l.print(ctx, level, "", values...)
|
||||
}
|
||||
|
||||
// printErr prints content `s` with stack check.
|
||||
func (l *Logger) printErr(ctx context.Context, level int, values ...interface{}) {
|
||||
// nil logger, print nothing
|
||||
if l == nil {
|
||||
return
|
||||
}
|
||||
var stack string
|
||||
if l.config.StStatus == 1 {
|
||||
stack = l.GetStack()
|
||||
|
||||
@ -142,5 +142,9 @@ func (l *Logger) Criticalf(ctx context.Context, format string, v ...interface{})
|
||||
|
||||
// checkLevel checks whether the given `level` could be output.
|
||||
func (l *Logger) checkLevel(level int) bool {
|
||||
// nil logger, print nothing
|
||||
if l == nil {
|
||||
return false
|
||||
}
|
||||
return l.config.Level&level > 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user