From e7488aff7a393a9ae8c75acd4849c91f16328cd3 Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Tue, 7 Nov 2017 14:15:38 +0100 Subject: [PATCH] Fix review comments Signed-off-by: Pavol Loffay --- cmd/agent/main.go | 2 +- cmd/collector/main.go | 2 +- cmd/flags/flags.go | 6 +++--- cmd/query/main.go | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/agent/main.go b/cmd/agent/main.go index f70b2dec1286..cef4e77a2d93 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/main.go @@ -64,7 +64,7 @@ func main() { if err := agent.Run(); err != nil { return errors.Wrap(err, "Failed to run the agent") } - select {} + return nil }, } diff --git a/cmd/collector/main.go b/cmd/collector/main.go index 21315bae373e..48f77119127c 100644 --- a/cmd/collector/main.go +++ b/cmd/collector/main.go @@ -134,7 +134,7 @@ func main() { case <-signalsChannel: logger.Info("Jaeger Collector is finishing") } - select {} + return nil }, } diff --git a/cmd/flags/flags.go b/cmd/flags/flags.go index 3190432cd036..00a9647189e2 100644 --- a/cmd/flags/flags.go +++ b/cmd/flags/flags.go @@ -33,7 +33,7 @@ const ( // ESStorageType is the storage type flag denoting an ElasticSearch backing store ESStorageType = "elasticsearch" spanStorageType = "span-storage.type" - logLevel = "log-Level" + logLevel = "log-level" dependencyStorageDataFrequency = "dependency-storage.data-frequency" configFile = "config-file" ) @@ -55,7 +55,7 @@ func TryLoadConfigFile(v *viper.Viper) error { return nil } -// NewLogger pareses log Level +// NewLogger returns logger based on configuration in SharedFlags func (flags *SharedFlags) NewLogger(conf zap.Config, options ...zap.Option) (*zap.Logger, error) { var level zapcore.Level err := (&level).UnmarshalText([]byte(flags.Logging.Level)) @@ -87,7 +87,7 @@ func (flags *SharedFlags) InitFromViper(v *viper.Viper) *SharedFlags { // AddFlags adds flags for SharedFlags func AddFlags(flagSet *flag.FlagSet) { flagSet.String(spanStorageType, CassandraStorageType, fmt.Sprintf("The type of span storage backend to use, options are currently [%v,%v,%v]", CassandraStorageType, ESStorageType, MemoryStorageType)) - flagSet.String(logLevel, "info", "Minimal allowed log Level. For more levels see zap logger documentation") + flagSet.String(logLevel, "info", "Minimal allowed log Level. For more levels see https://github.com/uber-go/zap") flagSet.Duration(dependencyStorageDataFrequency, time.Hour*24, "Frequency of service dependency calculations") } diff --git a/cmd/query/main.go b/cmd/query/main.go index b5134d28a697..a060bebbabaa 100644 --- a/cmd/query/main.go +++ b/cmd/query/main.go @@ -126,7 +126,7 @@ func main() { case <-serverChannel: logger.Info("Jaeger Query is finishing") } - select {} + return nil }, } @@ -141,6 +141,7 @@ func main() { ) if error := command.Execute(); error != nil { + fmt.Println("kik") fmt.Println(error.Error()) os.Exit(1) }