-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.go
executable file
·33 lines (28 loc) · 846 Bytes
/
app.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
package app
import (
//_ use native embed
_ "embed"
"fmt"
"github.com/cthiel77/server-demo/internal/cfg"
"github.com/cthiel77/server-demo/internal/log"
"github.com/cthiel77/server-demo/internal/meta"
flag "github.com/spf13/pflag"
)
var (
//go:embed usage.txt
flagModeUsage string
)
// InitFlags initializes application flags
func InitFlags() {
flag.StringVarP(&cfg.Mode, "mode", "m", cfg.ModeDefault, flagModeUsage)
}
// PrintConfig prints the config
func PrintConfig() {
fmt.Printf("AppName: %v\n", meta.GetAppName())
fmt.Printf("AppMode: %v\n", cfg.Mode)
fmt.Printf("logLevel: %v\n", log.LogLevel)
fmt.Printf("TimestampFormat: %v\n", log.TimestampFormat)
fmt.Printf("DisableTimestamp: %v\n", log.DisableTimestamp)
fmt.Printf("DisableColors: %v\n", log.DisableColors)
fmt.Printf("FullTimestamp: %v\n", log.FullTimestamp)
}