Ask the user to submit bugs

Provide directions for submitting bugs including what
data to include and how to enable debug logging.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
This commit is contained in:
Mark D Horn
2019-02-19 09:28:18 -08:00
committed by Mark Horn
parent 8c99371179
commit e904f1139a
3 changed files with 35 additions and 1 deletions
+2
View File
@@ -255,6 +255,7 @@ func main() {
fmt.Printf(" %s\n", err)
os.Exit(1)
} else {
log.RequestCrashInfo()
fatal(err)
}
}
@@ -287,5 +288,6 @@ func main() {
}
fatal(err)
}
log.RequestCrashInfo()
}
}
+23 -1
View File
@@ -86,7 +86,29 @@ func SetOutputFilename(logFile string) (*os.File, error) {
return filehandle, nil
}
// GetPreConfFile ... get the filename log output to filename instead of stdout/stderr
// RequestCrashInfo prints information for the user on how to properly report the
// crash of the installer and how to gather more information
func RequestCrashInfo() {
fmt.Println("Please report this crash using GitHub Issues:")
fmt.Println("\thttps://github.com/clearlinux/clr-installer/issues")
fmt.Println("")
fmt.Println("Include the following as attachments to enable diagnosis:")
fmt.Printf("\t%s\n", preConfName)
fmt.Printf("\t%s\n", logFileName)
fmt.Println("")
fmt.Println("If the problem persists, enabling additional logging will be helpful in")
fmt.Println("diagnosing the issue. At the OS Boot screen, hit 'e' to edit the kernel")
fmt.Println("command line. Add the following to the end of the line:")
fmt.Println("\tclri.loglevel=4")
fmt.Println("")
}
// GetPreConfFile ... returns the filename of where to store the pre-configuration file
func GetPreConfFile() string {
return preConfName
}
+10
View File
@@ -280,3 +280,13 @@ func TestFailedToSetOutput(t *testing.T) {
t.Fatal("Should have failed to open log file")
}
}
func TestGetPreConfFile(t *testing.T) {
if GetPreConfFile() != preConfName {
t.Fatal("log.GetPreConfFile() should always match log.preConfName")
}
}
func TestRequestCrashInfo(t *testing.T) {
RequestCrashInfo()
}