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{
|
&Switch{
|
||||||
Key: "loggingEnabled",
|
Key: "loggingEnabled",
|
||||||
Val: true,
|
Val: false,
|
||||||
Label: "Enable Logging Server",
|
Label: "Enable Logging Server",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ const (
|
|||||||
var (
|
var (
|
||||||
Log *CTopLogger
|
Log *CTopLogger
|
||||||
exited bool
|
exited bool
|
||||||
level = logging.DEBUG
|
level = logging.INFO
|
||||||
format = logging.MustStringFormatter(
|
format = logging.MustStringFormatter(
|
||||||
`%{color}%{time:15:04:05.000} ▶ %{level:.4s} %{id:03x}%{color:reset} %{message}`,
|
`%{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() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
ui.Clear()
|
ui.Clear()
|
||||||
fmt.Printf("panic: %s", r)
|
fmt.Printf("panic: %s\n", r)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
config.Init()
|
config.Init()
|
||||||
|
|
||||||
|
// init logger
|
||||||
log = logging.Init()
|
log = logging.Init()
|
||||||
if config.GetSwitchVal("loggingEnabled") {
|
if config.GetSwitchVal("loggingEnabled") {
|
||||||
logging.StartServer()
|
logging.StartServer()
|
||||||
}
|
}
|
||||||
cursor = NewGridCursor()
|
|
||||||
|
// init ui, grid
|
||||||
if err := ui.Init(); err != nil {
|
if err := ui.Init(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
cursor = NewGridCursor()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
exit := Display()
|
exit := Display()
|
||||||
|
2
menus.go
2
menus.go
@ -8,6 +8,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var helpDialog = []menu.Item{
|
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] - open this help dialog", ""},
|
||||||
menu.Item{"[H] - toggle cTop header", ""},
|
menu.Item{"[H] - toggle cTop header", ""},
|
||||||
menu.Item{"[s] - select container sort field", ""},
|
menu.Item{"[s] - select container sort field", ""},
|
||||||
|
Loading…
Reference in New Issue
Block a user