Add per area log levels at command line (#4813)
This commit is contained in:
parent
e5a65bc1b9
commit
bafb3a7e79
12 changed files with 27 additions and 69 deletions
|
|
@ -4,11 +4,8 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/evcc-io/evcc/server"
|
||||
"github.com/evcc-io/evcc/util"
|
||||
"github.com/samber/lo"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"golang.org/x/exp/slices"
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
|
@ -25,16 +22,11 @@ func init() {
|
|||
}
|
||||
|
||||
func runToken(cmd *cobra.Command, args []string) {
|
||||
util.LogLevel(viper.GetString("log"), viper.GetStringMapString("levels"))
|
||||
log.INFO.Printf("evcc %s", server.FormattedVersion())
|
||||
|
||||
// load config
|
||||
if err := loadConfigFile(&conf); err != nil {
|
||||
log.FATAL.Fatal(err)
|
||||
}
|
||||
|
||||
util.LogLevel(viper.GetString("log"), viper.GetStringMapString("levels"))
|
||||
|
||||
var vehicleConf qualifiedConfig
|
||||
if len(conf.Vehicles) == 1 {
|
||||
vehicleConf = conf.Vehicles[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue