mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
move dumpContainer method into debug
This commit is contained in:
parent
132335c8a4
commit
e1dc42db03
8
debug.go
8
debug.go
@ -18,6 +18,14 @@ func logEvent(e ui.Event) {
|
|||||||
log.Debugf("new event: %s", s)
|
log.Debugf("new event: %s", s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// log container, metrics, and widget state
|
||||||
|
func dumpContainer(c *Container) {
|
||||||
|
msg := fmt.Sprintf("logging state for container: %s\n", c.Id)
|
||||||
|
msg += fmt.Sprintf("Id = %s\nname = %s\nstate = %s\n", c.Id, c.Name, c.State)
|
||||||
|
msg += inspect(&c.Metrics)
|
||||||
|
log.Infof(msg)
|
||||||
|
}
|
||||||
|
|
||||||
func inspect(i interface{}) (s string) {
|
func inspect(i interface{}) (s string) {
|
||||||
val := reflect.ValueOf(i)
|
val := reflect.ValueOf(i)
|
||||||
elem := val.Type().Elem()
|
elem := val.Type().Elem()
|
||||||
|
8
grid.go
8
grid.go
@ -48,14 +48,6 @@ func RedrawRows() {
|
|||||||
ui.Render(cGrid)
|
ui.Render(cGrid)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log current container and widget state
|
|
||||||
func dumpContainer(c *Container) {
|
|
||||||
msg := fmt.Sprintf("logging state for container: %s\n", c.Id)
|
|
||||||
msg += fmt.Sprintf("Id = %s\nname = %s\nstate = %s\n", c.Id, c.Name, c.State)
|
|
||||||
msg += inspect(&c.Metrics)
|
|
||||||
log.Infof(msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
//func (g *Grid) ExpandView() {
|
//func (g *Grid) ExpandView() {
|
||||||
//ui.Clear()
|
//ui.Clear()
|
||||||
//ui.DefaultEvtStream.ResetHandlers()
|
//ui.DefaultEvtStream.ResetHandlers()
|
||||||
|
Loading…
Reference in New Issue
Block a user