How to turn off INFO/DEBUG messages from badger

Does anyone use badger for key/value storage? I’m trying to use it for a project but it seems to have set the log level to DEBUG because I keep seeing messages like:

badger 2019/06/19 22:11:06 DEBUG: Storing value log head: {Fid:0 Len:43 Offset:16038}
badger 2019/06/19 22:11:06 INFO: Got compaction priority: {level:0 score:1.73 dropPrefix:[]}
badger 2019/06/19 22:11:06 INFO: Running for level: 0
badger 2019/06/19 22:11:06 DEBUG: LOG Compact. Added 5 keys. Skipped 3 keys. Iteration took: 480.685µs
badger 2019/06/19 22:11:06 DEBUG: Discard stats: map[0:424]
badger 2019/06/19 22:11:06 INFO: LOG Compact 0->1, del 2 tables, add 1 tables, took 17.036862ms
badger 2019/06/19 22:11:06 INFO: Compaction for level: 0 DONE
badger 2019/06/19 22:11:06 INFO: Force compaction on level 0 done
badger 2019/06/19 22:11:06 INFO: All 1 tables opened in 0s
badger 2019/06/19 22:11:06 INFO: Replaying file id: 0 at offset: 16081
badger 2019/06/19 22:11:06 INFO: Replay took: 18.347µs

How do I turn them off?

Thanks,

Rob

OK, so I figured out how to turn it off completely be setting:

opts = badger.DefaultOptions
opts.Logger = nil

But looking at logger.go there doesn’t seem to be a way to set the log level…short of adding my own logger that is.

Rob

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.