mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
lower logging, add keybindings to help menu
This commit is contained in:
parent
a6c6ecc6ee
commit
a1d68833fa
@ -19,7 +19,7 @@ var switches = []*Switch{
|
||||
},
|
||||
&Switch{
|
||||
Key: "loggingEnabled",
|
||||
Val: true,
|
||||
Val: false,
|
||||
Label: "Enable Logging Server",
|
||||
},
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ const (
|
||||
var (
|
||||
Log *CTopLogger
|
||||
exited bool
|
||||
level = logging.DEBUG
|
||||
level = logging.INFO
|
||||
format = logging.MustStringFormatter(
|
||||
`%{color}%{time:15:04:05.000} ▶ %{level:.4s} %{id:03x}%{color:reset} %{message}`,
|
||||
)
|
||||
|
8
main.go
8
main.go
@ -22,21 +22,25 @@ func main() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ui.Clear()
|
||||
fmt.Printf("panic: %s", r)
|
||||
fmt.Printf("panic: %s\n", r)
|
||||
os.Exit(1)
|
||||
}
|
||||
}()
|
||||
|
||||
config.Init()
|
||||
|
||||
// init logger
|
||||
log = logging.Init()
|
||||
if config.GetSwitchVal("loggingEnabled") {
|
||||
logging.StartServer()
|
||||
}
|
||||
cursor = NewGridCursor()
|
||||
|
||||
// init ui, grid
|
||||
if err := ui.Init(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
cursor = NewGridCursor()
|
||||
|
||||
for {
|
||||
exit := Display()
|
||||
|
2
menus.go
2
menus.go
@ -8,6 +8,8 @@ import (
|
||||
)
|
||||
|
||||
var helpDialog = []menu.Item{
|
||||
menu.Item{"[a] - toggle display of all containers", ""},
|
||||
menu.Item{"[f] - filter displayed containers", ""},
|
||||
menu.Item{"[h] - open this help dialog", ""},
|
||||
menu.Item{"[H] - toggle cTop header", ""},
|
||||
menu.Item{"[s] - select container sort field", ""},
|
||||
|
Loading…
Reference in New Issue
Block a user