Skip to content

Commit

Permalink
feat: rename ReplaceAttr -> RenameLevels (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmzane authored Oct 10, 2023
1 parent 48789fb commit a60b04b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/example.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sloggen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func ParseLevel(s string) (slog.Level, error) {
}
}
func ReplaceAttr(_ []string, attr slog.Attr) slog.Attr {
func RenameLevels(_ []string, attr slog.Attr) slog.Attr {
if attr.Key != slog.LevelKey {
return attr
}
Expand All @@ -110,7 +110,7 @@ func TestExample(t *testing.T) {
src := attr.Value.Any().(*slog.Source)
src.File = filepath.Base(src.File)
}
return example.ReplaceAttr(groups, attr)
return example.RenameLevels(groups, attr)
}

var buf bytes.Buffer
Expand Down
2 changes: 1 addition & 1 deletion template.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func ParseLevel(s string) (slog.Level, error) {
}
}

func ReplaceAttr(_ []string, attr slog.Attr) slog.Attr {
func RenameLevels(_ []string, attr slog.Attr) slog.Attr {
if attr.Key != slog.LevelKey {
return attr
}
Expand Down

0 comments on commit a60b04b

Please sign in to comment.