Skip to content

Commit

Permalink
Support log-level flag on agent
Browse files Browse the repository at this point in the history
Signed-off-by: Won Jun Jang <wjang@uber.com>
  • Loading branch information
black-adder committed May 17, 2018
1 parent b5ade19 commit 8e0a027
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/agent/main.go
Expand Up @@ -73,6 +73,7 @@ func main() {
v,
command,
flags.AddConfigFileFlag,
flags.AddLoggingFlag,
app.AddFlags,
metrics.AddFlags,
)
Expand Down
7 changes: 6 additions & 1 deletion cmd/flags/flags.go
Expand Up @@ -77,8 +77,13 @@ func SetDefaultHealthCheckPort(port int) {
// AddFlags adds flags for SharedFlags
func AddFlags(flagSet *flag.FlagSet) {
flagSet.String(spanStorageType, "", fmt.Sprintf("Deprecated; please use %s environment variable", storage.SpanStorageTypeEnvVar))
flagSet.String(logLevel, "info", "Minimal allowed log Level. For more levels see https://github.com/uber-go/zap")
flagSet.Int(healthCheckHTTPPort, defaultHealthCheckPort, "The http port for the health check service")
AddLoggingFlag(flagSet)
}

// AddLoggingFlag adds logging flag for SharedFlags
func AddLoggingFlag(flagSet *flag.FlagSet) {
flagSet.String(logLevel, "info", "Minimal allowed log Level. For more levels see https://github.com/uber-go/zap")
}

// InitFromViper initializes SharedFlags with properties from viper
Expand Down

0 comments on commit 8e0a027

Please sign in to comment.