We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c81010e commit 977d4a5Copy full SHA for 977d4a5
replica.go
@@ -99,7 +99,11 @@ func (r *Replica) Name() string {
99
100
// Logger returns the DB sub-logger for this replica.
101
func (r *Replica) Logger() *slog.Logger {
102
- return r.db.Logger.With("replica", r.Name())
+ logger := slog.Default()
103
+ if r.db != nil {
104
+ logger = r.db.Logger
105
+ }
106
+ return logger.With("replica", r.Name())
107
}
108
109
// DB returns a reference to the database the replica is attached to, if any.
0 commit comments