mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
31 lines
442 B
Go
31 lines
442 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() {
|
|
log = logging.Init()
|
|
if config.GetToggle("loggingEnabled") {
|
|
log.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
|
|
}
|
|
}
|
|
}
|