internal logging library
This commit is contained in:
@@ -6,20 +6,20 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"ruben/inventory2/internal/consts"
|
||||
"ruben/inventory2/internal/domains/accounts"
|
||||
"ruben/inventory2/internal/domains/authentication"
|
||||
"ruben/inventory2/internal/logging"
|
||||
"ruben/inventory2/internal/server/cookies"
|
||||
"ruben/inventory2/internal/server/response"
|
||||
)
|
||||
|
||||
type (
|
||||
Auth struct {
|
||||
log *slog.Logger
|
||||
log *logging.Logger
|
||||
auth *authentication.Authenticator
|
||||
newLoginURL LoginURLProviderFunc
|
||||
accts *accounts.Store
|
||||
@@ -38,7 +38,7 @@ type (
|
||||
)
|
||||
|
||||
func NewAuth(
|
||||
logger *slog.Logger,
|
||||
logger *logging.Logger,
|
||||
auth *authentication.Authenticator,
|
||||
newLoginURL LoginURLProviderFunc,
|
||||
accts *accounts.Store,
|
||||
|
||||
@@ -2,14 +2,14 @@ package middleware
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"ruben/inventory2/internal/logging"
|
||||
"ruben/inventory2/internal/server/response"
|
||||
)
|
||||
|
||||
func LogRequests(ctx context.Context, logger *slog.Logger) response.Middleware {
|
||||
func LogRequests(ctx context.Context, logger *logging.Logger) response.Middleware {
|
||||
reqIDCh := newRequestIDProvider(ctx)
|
||||
|
||||
return func(fn response.HandlerFunc) response.HandlerFunc {
|
||||
|
||||
Reference in New Issue
Block a user