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 ca32add commit f305e7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const (
// MyCallersCallersCaller is the setting for the function that called the function that called the function that called the function calling MyCaller.
MyCallersCallersCaller = 6

twelve = 12

stackDepth = 32

// logLevelEnvVar is the environmental variable name used to set the log level, defaults to INFO if not set.
Expand Down Expand Up @@ -137,7 +139,7 @@ func setLogLevelName(a slog.Attr) slog.Attr {
// setCallerSourceName is used to set to source information to the caller of the function calling log.
func setCallerSourceName(a slog.Attr) slog.Attr {
if a.Key == slog.SourceKey { //nolint: nestif
source := GetCaller(MyCallersCaller, false)
source := GetCaller(twelve, false)
if sourcePathDepth >= 0 {
path := strings.Split(filepath.Dir(source.File), "/")
if len(path) < sourcePathDepth {
Expand Down

0 comments on commit f305e7d

Please sign in to comment.