mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
add logEvent hook
This commit is contained in:
parent
1a3968409b
commit
d5d00b730b
11
grid.go
11
grid.go
@ -127,11 +127,22 @@ func (g *Grid) ExpandView() {
|
||||
container.Collapse()
|
||||
}
|
||||
|
||||
func logEvent(e ui.Event) {
|
||||
var s string
|
||||
s += fmt.Sprintf("Type: %s\n", e.Type)
|
||||
s += fmt.Sprintf("Path: %s\n", e.Path)
|
||||
s += fmt.Sprintf("From: %s\n", e.From)
|
||||
s += fmt.Sprintf("To: %s", e.To)
|
||||
log.Debugf("new event:\n%s", s)
|
||||
}
|
||||
|
||||
func Display(g *Grid) bool {
|
||||
var menu func()
|
||||
var expand bool
|
||||
var loopIter int
|
||||
|
||||
ui.DefaultEvtStream.Hook(logEvent)
|
||||
|
||||
// calculate layout
|
||||
ui.Body.Align()
|
||||
g.redrawCursor()
|
||||
|
Loading…
Reference in New Issue
Block a user