mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
move logEvent into debug, condense output
This commit is contained in:
parent
52a3e61b92
commit
3bb48e91ae
17
debug.go
17
debug.go
@ -3,8 +3,21 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
ui "github.com/gizak/termui"
|
||||
)
|
||||
|
||||
func logEvent(e ui.Event) {
|
||||
var s string
|
||||
s += fmt.Sprintf("Type=%s", quote(e.Type))
|
||||
s += fmt.Sprintf(" Path=%s", quote(e.Path))
|
||||
s += fmt.Sprintf(" From=%s", quote(e.From))
|
||||
if e.To != "" {
|
||||
s += fmt.Sprintf(" To=%s", quote(e.To))
|
||||
}
|
||||
log.Debugf("new event: %s", s)
|
||||
}
|
||||
|
||||
func inspect(i interface{}) (s string) {
|
||||
val := reflect.ValueOf(i)
|
||||
elem := val.Type().Elem()
|
||||
@ -18,3 +31,7 @@ func inspect(i interface{}) (s string) {
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func quote(s string) string {
|
||||
return fmt.Sprintf("\"%s\"", s)
|
||||
}
|
||||
|
9
grid.go
9
grid.go
@ -151,15 +151,6 @@ func (g *Grid) dumpContainer() {
|
||||
//container.widgets.Reset()
|
||||
//}
|
||||
|
||||
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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user