lower logging, add keybindings to help menu

This commit is contained in:
Bradley Cicenas 2017-03-07 00:09:46 +00:00
parent a6c6ecc6ee
commit a1d68833fa
4 changed files with 10 additions and 4 deletions

View File

@ -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",
}, },
} }

View File

@ -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}`,
) )

View File

@ -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()

View File

@ -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", ""},