diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dbbc0b..649f114 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [v1.1.1] - 2024-12-19 + +* [#120](https://github.com/cosmos/cosmos-db/pull/120) Skip unwanted logs from PebbleDB + ## [v1.1.0] - 2024-11-22 * Allow full control in rocksdb opening diff --git a/pebble.go b/pebble.go index cea82b8..e31272f 100644 --- a/pebble.go +++ b/pebble.go @@ -72,6 +72,7 @@ var _ DB = (*PebbleDB)(nil) func NewPebbleDB(name string, dir string, opts Options) (DB, error) { do := &pebble.Options{ + Logger: &fatalLogger{}, // pebble info logs are messing up the logs (not a cosmossdk.io/log logger) MaxConcurrentCompactions: func() int { return 3 }, // default 1 } @@ -96,7 +97,6 @@ func NewPebbleDB(name string, dir string, opts Options) (DB, error) { // Get implements DB. func (db *PebbleDB) Get(key []byte) ([]byte, error) { - // fmt.Println("PebbleDB.Get") if len(key) == 0 { return nil, errKeyEmpty } @@ -492,3 +492,13 @@ func (itr *pebbleDBIterator) assertIsValid() { panic("iterator is invalid") } } + +type fatalLogger struct { + pebble.Logger +} + +func (*fatalLogger) Fatalf(format string, args ...interface{}) { + pebble.DefaultLogger.Fatalf(format, args...) +} + +func (*fatalLogger) Infof(format string, args ...interface{}) {}