diff --git a/cmd/placeholder.go b/cmd/placeholder.go index c2c6015..5242130 100644 --- a/cmd/placeholder.go +++ b/cmd/placeholder.go @@ -11,6 +11,7 @@ import ( "strings" "time" + "dbbackup/internal/logger" "dbbackup/internal/tui" "github.com/spf13/cobra" ) @@ -58,8 +59,9 @@ var interactiveCmd = &cobra.Command{ Long: `Start the interactive menu system for guided backup operations.`, Aliases: []string{"menu", "ui"}, RunE: func(cmd *cobra.Command, args []string) error { - // Start the interactive TUI - return tui.RunInteractiveMenu(cfg, log) + // Start the interactive TUI with silent logger to prevent console output conflicts + silentLog := logger.NewSilent() + return tui.RunInteractiveMenu(cfg, silentLog) }, } diff --git a/internal/logger/logger.go b/internal/logger/logger.go index e8c24e4..58a9134 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -78,6 +78,20 @@ func New(level, format string) Logger { } } +// NewSilent creates a logger that discards all output (for TUI mode) +func NewSilent() Logger { + l := logrus.New() + l.SetLevel(logrus.InfoLevel) + l.SetOutput(io.Discard) // Discard all log output + l.SetFormatter(&CleanFormatter{}) + + return &logger{ + logrus: l, + level: logrus.InfoLevel, + format: "text", + } +} + func (l *logger) Debug(msg string, args ...any) { l.logWithFields(logrus.DebugLevel, msg, args...) }