crashreport

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2023 License: MIT Imports: 3 Imported by: 0

README

CrashReport

A Simple package for writing crash reports.

Usage

Creating crash reports
func LoadTexture(path string){
    err := TextureManager.Load(path)
    if err == nil{
      report := crashreport.Crash("Invalid texture loaded").Include(path)
      report.WriteTo("./crashreport.crash")
    }
}

Viewing crash reports

$crashreport -browser ./path/to/crash/file.zip

Documentation

Index

Constants

Profiles

Variables

This section is empty.

Functions

func Crash deprecated

func Crash(reason string, w io.WriteCloser)

Crash write the the stacktrace and profiles to to w

Deprecated: This panics if any errors occur. Use NewCrashReport instead.

Types

type CrashReport

type CrashReport struct {
	// contains filtered or unexported fields
}

CrashReport a crash report. The Write/WriteTo methods may be used multiple times.

func NewCrashReport

func NewCrashReport(reason ...string) *CrashReport

NewCrashReport creates a new crash report

func (*CrashReport) Include

func (c *CrashReport) Include(p Profiles) *CrashReport

Include includes the given profiles in the crash report

func (*CrashReport) IncludeCustom

func (c *CrashReport) IncludeCustom(name string) *CrashReport

IncludeCustom includes a custom profile

func (*CrashReport) IncludeFile

func (c *CrashReport) IncludeFile(path string) *CrashReport

IncludeFile includes the given file in the crash report. Any errors when including these files are silently ignored.

func (*CrashReport) NoStack

func (c *CrashReport) NoStack() *CrashReport

NoStack excludes the stack from the crash report

func (*CrashReport) NoSysInfo

func (c *CrashReport) NoSysInfo() *CrashReport

NoSysInfo excludes system info from the crash report

func (*CrashReport) Reason

func (c *CrashReport) Reason(s ...string) *CrashReport

Reason appends the given strings to the reason

func (*CrashReport) Write

func (c *CrashReport) Write(w io.Writer) (err error)

func (*CrashReport) WriteTo

func (c *CrashReport) WriteTo(filename string) error

WriteTo writes the crash report to the given file

type Profiles

type Profiles = internal.Profiles

Profiles the profiles to be included in the report

Directories

Path Synopsis
cmd
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL