Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replacing logrus with slog v1 #2010

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removing unwanted methods from entry
  • Loading branch information
Madhur committed Dec 8, 2024
commit d48ecdf8b90c6b27133a4a068acafabb6ad116b0
16 changes: 5 additions & 11 deletions pkg/download/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,23 +502,17 @@ type testEntry struct {

var _ log.Entry = &testEntry{}

func (e *testEntry) Debugf(format string, args ...any) {
e.msg = format
}
func (*testEntry) Infof(format string, args ...any) {}
func (*testEntry) Warnf(format string, args ...any) {}
func (*testEntry) Errorf(format string, args ...any) {}
func (*testEntry) Fatalf(format string, args ...any) {}
func (*testEntry) Panicf(format string, args ...any) {}
func (*testEntry) Printf(format string, args ...any) {}
func (e *testEntry) Debugf(format string, args ...any) {e.msg = format}
func (e *testEntry) Infof(format string, args ...any) {e.msg = format}
func (e *testEntry) Warnf(format string, args ...any) {e.msg = format}
func (e *testEntry) Errorf(format string, args ...any) {e.msg = format}
func (e *testEntry) Fatalf(format string, args ...any) {e.msg = format}

func (*testEntry) Debug(args ...any) {}
func (*testEntry) Info(args ...any) {}
func (*testEntry) Warn(args ...any) {}
func (*testEntry) Error(args ...any) {}
func (*testEntry) Fatal(args ...any) {}
func (*testEntry) Panic(args ...any) {}
func (*testEntry) Print(args ...any) {}

func (*testEntry) WithFields(fields map[string]any) log.Entry { return nil }
func (*testEntry) SystemErr(err error) {}
Expand Down
12 changes: 0 additions & 12 deletions pkg/log/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ type LogOps interface {

// Fatal logs a fatal message and terminates the program.
Fatal(args ...interface{})

// Panic logs a panic message and panics.
Panic(args ...interface{})

// Print logs a message at default level.
Print(args ...interface{})
}

// FormattedLogOps is an extension of LogOps that supports formatted logging.
Expand All @@ -51,12 +45,6 @@ type FormattedLogOps interface {

// Fatalf logs a fatal message with formatting and terminates the program.
Fatalf(format string, args ...interface{})

// Panicf logs a panic message with formatting and panics.
Panicf(format string, args ...interface{})

// Printf logs a message with formatting at default level.
Printf(format string, args ...interface{})
}

// ContextualLogOps is a contextual logger that can be used to log messages with additional fields.
Expand Down
Loading