diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-28 11:23:27 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-02 17:29:27 -0700 |
commit | 301a28a093372f1182253d021659425070ae8747 (patch) | |
tree | 90113b4c4dac91ea5ad6f4342b45a9b9b2988007 /cmd/btrfs-rec | |
parent | 996137cdfdff9ec6fbb5c93e21d75b21052e01ae (diff) |
Shorten the log lines if < LogLevelDebug
Diffstat (limited to 'cmd/btrfs-rec')
-rw-r--r-- | cmd/btrfs-rec/main.go | 4 |
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{ |