Skip to content

Commit

Permalink
Add RPCs to fetch crash and console logs (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Mar 26, 2024
1 parent b94c90e commit 629ad8b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions trusted_os/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,28 @@ func (r *RPC) Reboot(_ *any, _ *bool) error {

return nil
}

// ConsoleLog returns the console log for the current running OS & applet.
func (r *RPC) ConsoleLog(_ *any, ret *[]byte) error {
if ret == nil {
return errors.New("nil buffer passed")
}

*ret = getConsoleLogs()
return nil
}

// CrashLog returns the console log stored by the OS after the last
// applet exit, if any.
func (r *RPC) CrashLog(_ *any, ret *[]byte) error {
if ret == nil {
return errors.New("nil buffer passed")
}

l, err := retrieveLastCrashLog(r.Storage)
if err != nil {
return err
}
*ret = l
return nil
}

0 comments on commit 629ad8b

Please sign in to comment.