mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
refactor widgets, add wrapper structs
This commit is contained in:
10
main.go
10
main.go
@@ -1,6 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/bcicen/ctop/config"
|
||||
"github.com/bcicen/ctop/logging"
|
||||
ui "github.com/gizak/termui"
|
||||
@@ -9,6 +12,13 @@ import (
|
||||
var log *logging.CTopLogger
|
||||
|
||||
func main() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ui.Clear()
|
||||
fmt.Printf("panic: %s", r)
|
||||
os.Exit(1)
|
||||
}
|
||||
}()
|
||||
config.Init()
|
||||
log = logging.Init()
|
||||
if config.GetSwitchVal("loggingEnabled") {
|
||||
|
||||
Reference in New Issue
Block a user