Skip to content

Commit

Permalink
update implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-carlton committed Oct 27, 2024
1 parent 306bf46 commit 23890e2
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions pkg/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,6 @@ func GetObjKindNamespaceName(obj k8sruntime.Object) (result []interface{}) {
func Callers(skip int, short bool) ([]slog.Source, error) {
var callers []slog.Source

if skip == 0 {
return callers, nil
}
// We get the callers as uintptrs.
fpcs := make([]uintptr, stackDepth)

Expand Down Expand Up @@ -336,15 +333,7 @@ func GetCaller(skip int, short bool) slog.Source {
if err != nil {
return slog.Source{Function: "not available", File: "not available", Line: 0}
}

if skip == 0 {
return slog.Source{Function: "not available", File: "not available", Line: 0}
}

if skip > len(callers) {
return slog.Source{Function: "not available", File: "not available", Line: 0}
}

// fmt.Printf("%s(%d) %s\n", callers[0].File, callers[0].Line, callers[0].Function)
return callers[0]
}

Expand Down

0 comments on commit 23890e2

Please sign in to comment.