From a3fdeccd616afcae5abd521e729bd486f6918a38 Mon Sep 17 00:00:00 2001 From: Peter Mattis Date: Mon, 18 May 2020 09:13:08 -0400 Subject: [PATCH] storage: quiet Pebble logging in tests Change Pebble's logging to match the behavior of RocksDB's logging for tests: the Pebble INFO logs are now only to the main log at `--v=3` and above. Previously the Pebble INFO logs were always being output if `InitPebbleLogger` had not been called, which is the case for almost all tests. Release note: None --- pkg/storage/pebble.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/storage/pebble.go b/pkg/storage/pebble.go index 52cb7242fe3d..5c0a4f236299 100644 --- a/pkg/storage/pebble.go +++ b/pkg/storage/pebble.go @@ -360,12 +360,12 @@ type pebbleLogger struct { func (l pebbleLogger) Infof(format string, args ...interface{}) { if pebbleLog != nil { pebbleLog.LogfDepth(l.ctx, l.depth, format, args...) - // Only log INFO logs to the normal CockroachDB log at --v=3 and above. - if !log.V(3) { - return - } + return + } + // Only log INFO logs to the normal CockroachDB log at --v=3 and above. + if log.V(3) { + log.InfofDepth(l.ctx, l.depth, format, args...) } - log.InfofDepth(l.ctx, l.depth, format, args...) } func (l pebbleLogger) Fatalf(format string, args ...interface{}) {