func (r *BugsnagCrashReporter) Send(err CrashError) error {
	if r.noReportFileExist() || r.apiKey == noreportAPIKey {
		log.Debug("Opting out of crash reporting.")
		return nil
	}

	if r.apiKey == "" {
		return errors.New("no api key has been set")
	}

	bugsnag.Configure(bugsnag.Configuration{
		APIKey: r.apiKey,
		// XXX we need to abuse bugsnag metrics to get the OS/ARCH information as a usable filter
		// Can do that with either "stage" or "hostname"
		ReleaseStage:    fmt.Sprintf("%s (%s)", runtime.GOOS, runtime.GOARCH),
		ProjectPackages: []string{"github.com/docker/machine/[^v]*"},
		AppVersion:      version.FullVersion(),
		Synchronous:     true,
		PanicHandler:    func() {},
		Logger:          new(logger),
	})

	metaData := bugsnag.MetaData{}

	metaData.Add("app", "compiler", fmt.Sprintf("%s (%s)", runtime.Compiler, runtime.Version()))
	metaData.Add("device", "os", runtime.GOOS)
	metaData.Add("device", "arch", runtime.GOARCH)

	detectRunningShell(&metaData)
	detectUname(&metaData)
	detectOSVersion(&metaData)
	addFile(err.LogFilePath, &metaData)

	var buffer bytes.Buffer
	for _, message := range log.History() {
		buffer.WriteString(message + "\n")
	}
	metaData.Add("history", "trace", buffer.String())

	return bugsnag.Notify(err.Cause, metaData, bugsnag.SeverityError, bugsnag.Context{String: err.Context}, bugsnag.ErrorClass{Name: fmt.Sprintf("%s/%s", err.DriverName, err.Command)})
}
func (r *BugsnagCrashReporter) Send(err CrashError) error {
	if r.noReportFileExist() || r.apiKey == noreportAPIKey {
		log.Debug("Opting out of crash reporting.")
		return nil
	}

	if r.apiKey == "" {
		return errors.New("no api key has been set")
	}

	bugsnag.Configure(bugsnag.Configuration{
		APIKey: r.apiKey,
		
		
		ReleaseStage:    fmt.Sprintf("%s (%s)", runtime.GOOS, runtime.GOARCH),
		ProjectPackages: []string{"github.com/docker/machine/[^v]*"},
		AppVersion:      version.FullVersion(),
		Synchronous:     true,
		PanicHandler:    func() {},
		Logger:          new(logger),
	})

	metaData := bugsnag.MetaData{}

	metaData.Add("app", "compiler", fmt.Sprintf("%s (%s)", runtime.Compiler, runtime.Version()))
	metaData.Add("device", "os", runtime.GOOS)
	metaData.Add("device", "arch", runtime.GOARCH)

	detectRunningShell(&metaData)
	detectUname(&metaData)
	detectOSVersion(&metaData)
	addFile(err.LogFilePath, &metaData)

	var buffer bytes.Buffer
	for _, message := range log.History() {
		buffer.WriteString(message + "\n")
	}
	metaData.Add("history", "trace", buffer.String())

	return bugsnag.Notify(err.Cause, metaData, bugsnag.SeverityError, bugsnag.Context{String: err.Context}, bugsnag.ErrorClass{Name: fmt.Sprintf("%s/%s", err.DriverName, err.Command)})
}
func ( r * BugsnagCrashReporter ) Send ( err CrashError ) error { if r . noReportFileExist ( ) || r . apiKey == noreportAPIKey { log . Debug ( " " ) return nil } if r . apiKey == " " { return errors . New ( " " ) } bugsnag . Configure ( bugsnag . Configuration { APIKey : r . apiKey , // XXX we need to abuse bugsnag metrics to get the OS/ARCH information as a usable filter // Can do that with either "stage" or "hostname" ReleaseStage : fmt . Sprintf ( " " , runtime . GOOS , runtime . GOARCH ) , ProjectPackages : [ ] string { " " } , AppVersion : version . FullVersion ( ) , Synchronous : true , PanicHandler : func ( ) { } , Logger : new ( logger ) , } ) metaData := bugsnag . MetaData { } metaData . Add ( " " , " " , fmt . Sprintf ( " " , runtime . Compiler , runtime . Version ( ) ) ) metaData . Add ( " " , " " , runtime . GOOS ) metaData . Add ( " " , " " , runtime . GOARCH ) detectRunningShell ( & metaData ) detectUname ( & metaData ) detectOSVersion ( & metaData ) addFile ( err . LogFilePath , & metaData ) var buffer bytes . Buffer for _ , message := range log . History ( ) { buffer . WriteString ( message + " \n " ) } metaData . Add ( " " , " " , buffer . String ( ) ) return bugsnag . Notify ( err . Cause , metaData , bugsnag . SeverityError , bugsnag . Context { String : err . Context } , bugsnag . ErrorClass { Name : fmt . Sprintf ( " " , err . DriverName , err . Command ) } ) }
// Send sends a crash report to bugsnag via an http call.
Send sends a crash report to bugsnag via an http call .