From d2b28d82c3d302b39f513f31e894a4b780fe33bb Mon Sep 17 00:00:00 2001 From: Nathan Villaescusa Date: Fri, 29 Mar 2024 13:04:52 -0700 Subject: [PATCH] Mode var --- main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 4a71ec43..1b3c0d9d 100644 --- a/main.go +++ b/main.go @@ -107,14 +107,15 @@ func main() { logProgress := !isStreamingMode _writer := writer.New(destination, logProgress) + mode := "snapshot" if isStreamingMode { - slog.Info("Starting stream...") - } else { - slog.Info("Starting snapshot...") + mode = "stream" } + slog.Info(fmt.Sprintf("Starting %s...", mode)) + if err = source.Run(ctx, _writer); err != nil { - logger.Fatal("Failed to run", + logger.Fatal(fmt.Sprintf("Failed to %s", mode), slog.Any("err", err), slog.String("source", string(cfg.Source)), slog.String("destination", string(cfg.Destination)),