Files
mpc/pkg/kvstore/badger_logger.go
zeekay 92a6aac8b1 feat: migrate from dgraph-io/badger to luxfi/zapdb v4.9.3
Replace all dgraph-io/badger/v4 imports with luxfi/zapdb/v4 across
kvstore, storage, migration scripts, and e2e tests. ZapDB is our
rebranded fork with ZAP native binary encoding and no OpenTelemetry
dependencies.
2026-03-11 23:09:02 -07:00

34 lines
885 B
Go

package kvstore
import (
"fmt"
"github.com/luxfi/zapdb/v4"
"github.com/hanzoai/mpc/pkg/logger"
)
// quietBadgerLogger is a custom logger that suppresses INFO and DEBUG messages
// but allows ERROR and WARNING messages to be logged
type quietBadgerLogger struct{}
func newQuietBadgerLogger() badger.Logger {
return &quietBadgerLogger{}
}
func (ql *quietBadgerLogger) Errorf(format string, args ...interface{}) {
logger.Error("[BADGER] ERROR", nil, "message", fmt.Sprintf(format, args...))
}
func (ql *quietBadgerLogger) Warningf(format string, args ...interface{}) {
logger.Warn("[BADGER] WARN", "message", fmt.Sprintf(format, args...))
}
func (ql *quietBadgerLogger) Infof(format string, args ...interface{}) {
// Suppress INFO messages - do nothing
}
func (ql *quietBadgerLogger) Debugf(format string, args ...interface{}) {
// Suppress DEBUG messages - do nothing
}