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

log: fix some functions comments #29907

Merged
merged 10 commits into from
Jun 17, 2024
4 changes: 2 additions & 2 deletions log/handler_glog.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ func (h *GlogHandler) WithGroup(name string) slog.Handler {
panic("not implemented")
}

// Log implements Handler.Log, filtering a log record through the global, local
// and backtrace filters, finally emitting it if either allow it through.
// Handle implements slog.Handler.Handle, filtering a log record through the global, local
BabyHalimao marked this conversation as resolved.
Show resolved Hide resolved
// and backtrace filters, finally emitting it if either allows it through.
func (h *GlogHandler) Handle(_ context.Context, r slog.Record) error {
// If the global log level allows, fast track logging
if slog.Level(h.level.Load()) <= r.Level {
Expand Down
6 changes: 3 additions & 3 deletions log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
LvlDebug = LevelDebug
)

// convert from old Geth verbosity level constants
// FromLegacyLevel converts from old Geth verbosity level constants
// to levels defined by slog
func FromLegacyLevel(lvl int) slog.Level {
switch lvl {
Expand Down Expand Up @@ -107,7 +107,7 @@ type Logger interface {
// With returns a new Logger that has this logger's attributes plus the given attributes
With(ctx ...interface{}) Logger

// With returns a new Logger that has this logger's attributes plus the given attributes. Identical to 'With'.
// New returns a new Logger that has this logger's attributes plus the given attributes. Identical to 'With'.
New(ctx ...interface{}) Logger

// Log logs a message at the specified level with context key/value pairs
Expand Down Expand Up @@ -156,7 +156,7 @@ func (l *logger) Handler() slog.Handler {
return l.inner.Handler()
}

// Write logs a message at the specified level:
// Write logs a message at the specified level.
func (l *logger) Write(level slog.Level, msg string, attrs ...any) {
if !l.inner.Enabled(context.Background(), level) {
return
Expand Down