ctop/main.go
2017-02-17 17:48:38 +11:00

32 lines
464 B
Go

package main
import (
"github.com/bcicen/ctop/config"
"github.com/bcicen/ctop/logging"
ui "github.com/gizak/termui"
)
var log *logging.CTopLogger
func main() {
config.Init()
log = logging.Init()
if config.GetSwitchVal("loggingEnabled") {
logging.StartServer()
}
if err := ui.Init(); err != nil {
panic(err)
}
defer ui.Close()
g := NewGrid()
for {
exit := Display(g)
if exit {
log.Notice("shutting down")
log.Exit()
return
}
}
}