aboutsummaryrefslogtreecommitdiff
path: root/internal/cli/log.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli/log.go')
-rw-r--r--internal/cli/log.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/cli/log.go b/internal/cli/log.go
new file mode 100644
index 0000000..c837649
--- /dev/null
+++ b/internal/cli/log.go
@@ -0,0 +1,22 @@
+package cli
+
+import (
+ "tsne.dev/hopper/internal/log"
+)
+
+// logAction prints a per-action line.
+// In dry-run mode the line is prefixed with "[dryrun] ".
+func logAction(format string, args ...any) {
+ if dryRun {
+ format = "[dryrun] " + format
+ }
+ log.Print(format, args...)
+}
+
+// logSummary prints the final summary line.
+func logSummary(format string, args ...any) {
+ if dryRun {
+ format += "\n\nNote: This was a dry run. Nothing on the zone was modified."
+ }
+ log.PrintImportant(format, args...)
+}