summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-28 11:23:27 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-02 17:29:27 -0700
commit301a28a093372f1182253d021659425070ae8747 (patch)
tree90113b4c4dac91ea5ad6f4342b45a9b9b2988007 /cmd
parent996137cdfdff9ec6fbb5c93e21d75b21052e01ae (diff)
Shorten the log lines if < LogLevelDebug
Diffstat (limited to 'cmd')
-rw-r--r--cmd/btrfs-rec/main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/btrfs-rec/main.go b/cmd/btrfs-rec/main.go
index d4165bf..dc00dab 100644
--- a/cmd/btrfs-rec/main.go
+++ b/cmd/btrfs-rec/main.go
@@ -103,7 +103,9 @@ func main() {
ctx := cmd.Context()
logger := textui.NewLogger(os.Stderr, logLevelFlag.Level)
ctx = dlog.WithLogger(ctx, logger)
- ctx = dlog.WithField(ctx, "mem", new(textui.LiveMemUse))
+ if logLevelFlag.Level >= dlog.LogLevelDebug {
+ ctx = dlog.WithField(ctx, "mem", new(textui.LiveMemUse))
+ }
dlog.SetFallbackLogger(logger.WithField("btrfs-progs.THIS_IS_A_BUG", true))
grp := dgroup.NewGroup(ctx, dgroup.GroupConfig{