mirror of
https://github.com/clearlinux/clr-installer.git
synced 2026-09-03 12:11:27 +00:00
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:
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user