From 70e0d783a6186f61f14042093add6265a86f86d9 Mon Sep 17 00:00:00 2001 From: Max Fisher Date: Thu, 19 Oct 2023 14:38:37 +1100 Subject: [PATCH] negate boolean polarity of flag Signed-off-by: Max Fisher --- internal/featureflags/features.go | 7 +++---- internal/worker/rundynamic.go | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/featureflags/features.go b/internal/featureflags/features.go index 747d9513..306d8282 100644 --- a/internal/featureflags/features.go +++ b/internal/featureflags/features.go @@ -18,8 +18,7 @@ var ( // methods and classes are logged to a file. CodeExecution = new("CodeExecution", false) - // DisableStraceDebugLogging prevents debug logging of strace parsing during - // dynamic analysis. Since the strace parsing produces a large amount of debug - // output, it can be useful to disable this when the information is not needed. - DisableStraceDebugLogging = new("DisableStraceDebugLogging", false) + // StraceDebugLogging enables verbose logging of strace parsing during dynamic analysis. + // It is useful for debugging strace parsing code but can be safely disabled otherwise. + StraceDebugLogging = new("StraceDebugLogging", true) ) diff --git a/internal/worker/rundynamic.go b/internal/worker/rundynamic.go index f66a3072..a022a7ca 100644 --- a/internal/worker/rundynamic.go +++ b/internal/worker/rundynamic.go @@ -132,12 +132,12 @@ func RunDynamicAnalysis(ctx context.Context, pkg *pkgmanager.Pkg, sbOpts []sandb } // getStraceLogger returns an slog.Logger instance for the strace parsing functions. -// If featureflags.DisableStraceDebugLogging is enabled, the logger will discard any +// If featureflags.StraceDebugLogging is disabled, the logger will discard any // log messages with level below slog.LevelInfo (i.e. LevelDebug). Otherwise, the // default logging method is used. func getStraceLogger(ctx context.Context) *slog.Logger { logger := slog.Default() - if featureflags.DisableStraceDebugLogging.Enabled() { + if !featureflags.StraceDebugLogging.Enabled() { infoOnly := &slog.HandlerOptions{Level: slog.LevelInfo} logger = slog.New(slog.NewTextHandler(os.Stderr, infoOnly)) }