Skip to content

Commit

Permalink
Mode var
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed Mar 29, 2024
1 parent 5d15124 commit d2b28d8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit d2b28d8

Please sign in to comment.