Skip to content

Commit

Permalink
chore: fixed type name
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed May 15, 2024
1 parent f3352be commit 1bbd195
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions log/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

const RequestIDKey = "requestID"

type LogFunc func(l slog.Logger)
type Func func(l slog.Logger)

type Context struct {
Logger *slog.Logger
Expand Down Expand Up @@ -53,10 +53,8 @@ func NewContext(uuid string) Context {
}
}

func Log(ctx context.Context, logFunc LogFunc) {
loggerCtx, ok := ctx.(Context)

if ok {
func Log(ctx context.Context, logFunc Func) {
if loggerCtx, ok := ctx.(Context); ok {
logFunc(*loggerCtx.Logger)
} else {
logFunc(*slog.Default())
Expand Down

0 comments on commit 1bbd195

Please sign in to comment.