Skip to content

Commit

Permalink
Log that gRPC is listening only when it is listening
Browse files Browse the repository at this point in the history
  • Loading branch information
emersonian committed Apr 24, 2024
1 parent cd069ac commit 34e7596
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ func startServer(opts *common.Options) error {

logger.SetLevel(logrus.Level(opts.LogLevel))

common.Log.WithFields(logrus.Fields{
"gitCommit": common.GitCommit,
"buildDate": common.BuildDate,
"buildUser": common.BuildUser,
}).Infof("Starting gRPC server version %s on %s", common.Version, opts.GRPCBindAddr)

logging.LogToStderr = opts.GRPCLogging

// gRPC initialization
Expand Down Expand Up @@ -277,6 +271,12 @@ func startServer(opts *common.Options) error {
}
}()

common.Log.WithFields(logrus.Fields{
"gitCommit": common.GitCommit,
"buildDate": common.BuildDate,
"buildUser": common.BuildUser,
}).Infof("Starting gRPC server version %s on %s", common.Version, opts.GRPCBindAddr)

// Start listening
listener, err := net.Listen("tcp", opts.GRPCBindAddr)
if err != nil {
Expand Down

0 comments on commit 34e7596

Please sign in to comment.