Skip to content

Commit

Permalink
API: Use correct Enabled check in logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Fesaa committed Sep 26, 2024
1 parent a5a83c9 commit 0793eb8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package log

import (
"context"
"github.com/Fesaa/Media-Provider/config"
"log/slog"
"os"
"runtime"
"time"

"github.com/Fesaa/Media-Provider/config"
)

const (
Expand Down Expand Up @@ -138,7 +139,7 @@ func (l *Logger) SetSource(source bool) {
// this is almost a copy of the slog.log function
func (l *Logger) log(level slog.Level, msg string, args ...any) {
ctx := context.Background()
if !slog.Default().Enabled(ctx, level) {
if !l._log.Enabled(ctx, level) {
return
}
var pc uintptr
Expand Down

0 comments on commit 0793eb8

Please sign in to comment.