TUN-1389: Non-scalar flags in a cloudflared config.yml don't get logged

This commit is contained in:
Areg Harutyunyan 2019-03-08 02:36:24 -06:00
parent 5a0b7ecb62
commit b02718f86b
1 changed files with 9 additions and 1 deletions

View File

@ -70,8 +70,16 @@ func logClientOptions(c *cli.Context) {
for _, flag := range c.LocalFlagNames() { for _, flag := range c.LocalFlagNames() {
flags[flag] = c.Generic(flag) flags[flag] = c.Generic(flag)
} }
sliceFlags := []string{"header", "tag", "proxy-dns-upstream", "upstream", "edge"}
for _, sliceFlag := range sliceFlags {
if len(c.StringSlice(sliceFlag)) > 0 {
flags[sliceFlag] = strings.Join(c.StringSlice(sliceFlag), ", ")
}
}
if len(flags) > 0 { if len(flags) > 0 {
logger.Infof("Flags %v", flags) logger.WithFields(flags).Info("Flags")
} }
envs := make(map[string]string) envs := make(map[string]string)