Skip to content

Commit

Permalink
Switched back to using log
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders Janmyr committed Sep 25, 2015
1 parent 1251bbe commit f36084d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"log"
"os"
"path"
"strings"
Expand Down Expand Up @@ -95,10 +96,11 @@ func updateRecords(sourceProfile, destProfile, domain string, changes []*route53
}

func main() {
log.SetFlags(0)
program := path.Base(os.Args[0])
args := os.Args[1:]
if len(args) < 3 {
fmt.Printf("Usage: %s <source_profile> <dest_profile> <domain>\n", program)
log.Fatalf("Usage: %s <source_profile> <dest_profile> <domain>\n", program)
}
sourceProfile := args[0]
destProfile := args[1]
Expand All @@ -108,12 +110,12 @@ func main() {
panic(err)
}
changes := createChanges(domain, recordSets)
fmt.Println("Number of changes", len(changes))
log.Println("Number of changes", len(changes))
changeInfo, err := updateRecords(sourceProfile, destProfile, domain, changes)
if err != nil {
panic(err)
}
fmt.Printf("%d records in '%s' are copied from %s to %s",
log.Printf("%d records in '%s' are copied from %s to %s",
len(changes), domain, sourceProfile, destProfile)
fmt.Printf("%#v\n", changeInfo)
log.Printf("%#v\n", changeInfo)
}

0 comments on commit f36084d

Please sign in to comment.