Generate crash report txt and webpage
The last 100 lines of logs are now cached, and when a crash occurs, they
are saved to a file in the temp directory ("/tmp" on *nix), and pretty
HTML version is also created and opened in the browser.
* Currently only handles panics, will be included in more places soon
* Copy button and button to generate a GH issue will be added
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package linecache
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Test(t *testing.T) {
|
||||
wr := NewLineCache(10)
|
||||
for i := 10; i < 50; i++ {
|
||||
fmt.Fprintln(wr, i)
|
||||
fmt.Print(strings.ReplaceAll(wr.String(), "\n", " "), "\n")
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user