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 authored and Larry Ruane committed Jul 10, 2024
1 parent 6e3816b commit 93b8973
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ func startServer(opts *common.Options) error {

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

logging.LogToStderr = opts.GRPCLogging

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
}).Infof("Starting lightwalletd process version %s", common.Version)

// gRPC initialization
var server *grpc.Server
Expand Down Expand Up @@ -282,6 +282,8 @@ func startServer(opts *common.Options) error {
walletrpc.RegisterDarksideStreamerServer(server, service)
}

common.Log.Infof("Starting gRPC server on %s", opts.GRPCBindAddr)

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

0 comments on commit 93b8973

Please sign in to comment.