-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
40 lines (31 loc) · 1012 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"github.com/GridPlus/phonon-client/internal/config"
"github.com/GridPlus/phonon-client/internal/config/hooks"
"github.com/GridPlus/phonon-client/pkg/gui"
log "github.com/sirupsen/logrus"
)
func main() {
cfg, err := config.LoadConfig()
if err != nil {
log.Fatal("Unable to load configuration")
}
if cfg.TelemetryKey != "" {
log.Debug("setting up logging hook")
log.AddHook(hooks.NewLoggingHook(cfg.TelemetryKey))
}
log.SetLevel(log.DebugLevel)
log.SetFormatter(&log.JSONFormatter{})
log.Debug("starting local api server")
// parse configuration
//todo: make a graphical window pop up indicating an error state
//////////////////////////////////
// An error has occured: //
// "something something" //
// -------- //
// | ok | //
// ________ //
//////////////////////////////////
// initialize backends
gui.Server("8080", "", "", false, log.StandardLogger(), cfg.Certificate)
}