Skip to content

Commit

Permalink
disable more inlining methods for go1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
phuslu committed Aug 18, 2024
1 parent 12d35e2 commit e879787
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,8 @@ func (e *Entry) TimesFormat(key string, timefmt string, a []time.Time) *Entry {
}

// Bool append append the val as a bool to the entry.
//
//go:noinline
func (e *Entry) Bool(key string, b bool) *Entry {
if e == nil {
return nil
Expand All @@ -795,6 +797,8 @@ func (e *Entry) Bool(key string, b bool) *Entry {
}

// Bools adds the field key with val as a []bool to the entry.
//
//go:noinline
func (e *Entry) Bools(key string, b []bool) *Entry {
if e == nil {
return nil
Expand Down Expand Up @@ -921,6 +925,8 @@ func (e *Entry) Durs(key string, d []time.Duration) *Entry {
}

// Err adds the field "error" with serialized err to the entry.
//
//go:noinline
func (e *Entry) Err(err error) *Entry {
return e.AnErr("error", err)
}
Expand Down Expand Up @@ -2129,8 +2135,10 @@ func (e *Entry) Objects(key string, objects any) *Entry {
}

// Func allows an anonymous func to run only if the entry is enabled.
//
//go:nonline
func (e *Entry) Func(f func(e *Entry)) *Entry {
if e != nil {
if e != nil && f != nil {
f(e)
}
return e
Expand Down Expand Up @@ -2309,6 +2317,8 @@ func (e *Entry) Value() Context {
}

// Context sends the contextual fields to entry.
//
//go:noinline
func (e *Entry) Context(ctx Context) *Entry {
if e == nil {
return nil
Expand Down

0 comments on commit e879787

Please sign in to comment.