File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ tolerations: []
6363affinity : {}
6464
6565configuration :
66+ log_level : info
6667 host : 0.0.0.0
6768 port : 80
6869 data_path : /data
Original file line number Diff line number Diff line change 99)
1010
1111type Configuration struct {
12+ LogLevel string `yaml:"log_level"`
13+
1214 Host string `yaml:"host"`
1315 Port int `yaml:"port"`
1416 DataPath string `yaml:"data_path"`
@@ -23,6 +25,7 @@ type Configuration struct {
2325}
2426
2527var DefaultConfiguration = Configuration {
28+ LogLevel : "info" ,
2629 Host : "0.0.0.0" ,
2730 Port : 80 ,
2831 DataPath : "/etc/speakerbob/data" ,
Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ func Server(*cobra.Command, []string) {
3535 logrus .Fatal (err )
3636 }
3737
38+ // set log level
39+ level , err := logrus .ParseLevel (config .LogLevel )
40+ if err != nil {
41+ logrus .Fatal (err )
42+ }
43+ logrus .SetLevel (level )
44+
3845 // setup the store
3946 badgerdbOptions := badger .DefaultOptions (config .DataPath )
4047 badgerdbOptions .Logger = logrus .StandardLogger ()
You can’t perform that action at this time.
0 commit comments