Skip to content

Commit

Permalink
Clean up logging a little
Browse files Browse the repository at this point in the history
Reduce some of the scary chatter that isn't necessarily bad during
initial startup on a fresh system.
  • Loading branch information
Daniel Hiltgen committed Feb 5, 2016
1 parent 4bc0ec9 commit 8d63cea
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions kvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (d *Driver) GetURL() (string, error) {
log.Debugf("GetURL called")
ip, err := d.GetIP()
if err != nil {
log.Warnf("Failed to get IP: %s", err)
log.Debugf("Failed to get IP: %s", err)
return "", err
}
if ip == "" {
Expand Down Expand Up @@ -300,7 +300,7 @@ func (d *Driver) Create() error {
return err
}

log.Infof("Creating SSH key...")
log.Debug("Creating SSH key...")
if err := ssh.GenerateSSHKey(d.GetSSHKeyPath()); err != nil {
return err
}
Expand All @@ -325,12 +325,12 @@ func (d *Driver) Create() error {
}
}

log.Debugf("Creating VM data disk...")
log.Debug("Creating VM data disk...")
if err := d.generateDiskImage(d.DiskSize); err != nil {
return err
}

log.Debugf("Defining VM...")
log.Debug("Defining VM...")
tmpl, err := template.New("domain").Parse(domainXMLTemplate)
if err != nil {
return err
Expand Down Expand Up @@ -559,6 +559,9 @@ func (d *Driver) getIPByMacFromSettings(mac string) (string, error) {
}
statusFile := fmt.Sprintf(dnsmasqStatus, bridge_name)
data, err := ioutil.ReadFile(statusFile)
if err != nil {
return "", err
}
type Lease struct {
Ip_address string `json:"ip-address"`
Mac_address string `json:"mac-address"`
Expand All @@ -568,7 +571,7 @@ func (d *Driver) getIPByMacFromSettings(mac string) (string, error) {

err = json.Unmarshal(data, &s)
if err != nil {
log.Warnf("Failed to decode dnsmasq lease status: %s", err)
log.Debugf("Failed to decode dnsmasq lease status: %s", err)
return "", err
}
for _, value := range s {
Expand Down

0 comments on commit 8d63cea

Please sign in to comment.