Add debug log ring buffer with timestamps, log CLI subcommand
This commit is contained in:
@@ -93,6 +93,10 @@ func (c *Client) Info() (*ResponseInfo, error) {
|
||||
return roundTrip[ResponseInfo](c, &RequestInfo{})
|
||||
}
|
||||
|
||||
func (c *Client) Log() (*ResponseLog, error) {
|
||||
return roundTrip[ResponseLog](c, &RequestLog{})
|
||||
}
|
||||
|
||||
func (c *Client) Test(name string) (*ResponseTest, error) {
|
||||
return roundTrip[ResponseTest](c, &RequestTest{Name: name})
|
||||
}
|
||||
|
||||
@@ -13,6 +13,17 @@ type ResponseInfo struct {
|
||||
FirmwareName string
|
||||
}
|
||||
|
||||
type RequestLog struct{}
|
||||
|
||||
type LogEntry struct {
|
||||
TimestampUS uint32
|
||||
Message string
|
||||
}
|
||||
|
||||
type ResponseLog struct {
|
||||
Entries []LogEntry
|
||||
}
|
||||
|
||||
type RequestTest struct {
|
||||
Name string
|
||||
}
|
||||
@@ -44,6 +55,8 @@ func init() {
|
||||
msgpack.RegisterExt(3, (*ResponsePICOBOOT)(nil))
|
||||
msgpack.RegisterExt(4, (*RequestInfo)(nil))
|
||||
msgpack.RegisterExt(5, (*ResponseInfo)(nil))
|
||||
msgpack.RegisterExt(6, (*RequestLog)(nil))
|
||||
msgpack.RegisterExt(7, (*ResponseLog)(nil))
|
||||
msgpack.RegisterExt(127, (*RequestTest)(nil))
|
||||
msgpack.RegisterExt(126, (*ResponseTest)(nil))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user