Add vbox.log to crashreport

Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
This commit is contained in:
Jean-Laurent de Morlhon
2015-12-17 13:42:09 +01:00
parent 32795c9d1f
commit fd25762c05
3 changed files with 72 additions and 3 deletions

View File

@@ -98,7 +98,7 @@ func (api *Client) Create(h *host.Host) error {
log.Info("Creating machine...")
if err := api.performCreate(h); err != nil {
crashreport.Send(err, "api.performCreate", h.DriverName, "Create")
sendCrashReport(err, api, h)
return err
}
@@ -152,3 +152,12 @@ func (api *Client) performCreate(h *host.Host) error {
return nil
}
func sendCrashReport(err error, api *Client, host *host.Host) {
if host.DriverName == "virtualbox" {
vboxlogPath := filepath.Join(api.GetMachinesDir(), host.Name, host.Name, "Logs", "VBox.log")
crashreport.SendWithFile(err, "api.performCreate", host.DriverName, "Create", vboxlogPath)
} else {
crashreport.Send(err, "api.performCreate", host.DriverName, "Create")
}
}