MCPcopy Create free account
hub / github.com/convox/rack / SystemLogs

Method SystemLogs

pkg/api/controllers.go:1213–1241  ·  view source on GitHub ↗
(c *stdapi.Context)

Source from the content-addressed store, hash-verified

1211}
1212
1213func (s *Server) SystemLogs(c *stdapi.Context) error {
1214 if err := s.hook("SystemLogsValidate", c); err != nil {
1215 return err
1216 }
1217
1218 var opts structs.LogsOptions
1219 if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil {
1220 return err
1221 }
1222
1223 v, err := s.provider(c).WithContext(c.Context()).SystemLogs(opts)
1224 if err != nil {
1225 return err
1226 }
1227
1228 if c, ok := interface{}(v).(io.Closer); ok {
1229 defer c.Close()
1230 }
1231
1232 if _, err := io.Copy(c, v); err != nil {
1233 return err
1234 }
1235
1236 if vs, ok := interface{}(v).(Sortable); ok {
1237 sort.Slice(v, vs.Less)
1238 }
1239
1240 return nil
1241}
1242
1243func (s *Server) SystemMetrics(c *stdapi.Context) error {
1244 if err := s.hook("SystemMetricsValidate", c); err != nil {

Callers

nothing calls this directly

Calls 8

hookMethod · 0.95
providerMethod · 0.95
RequestMethod · 0.80
ContextMethod · 0.80
SliceMethod · 0.80
SystemLogsMethod · 0.65
WithContextMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected