kezhenxu94 commented on a change in pull request #44:
URL: https://github.com/apache/skywalking-cli/pull/44#discussion_r457149409



##########
File path: commands/common/common.go
##########
@@ -18,19 +18,50 @@
 package common
 
 import (
+       "fmt"
+
        "github.com/urfave/cli"
 
-       "github.com/apache/skywalking-cli/display"
-       "github.com/apache/skywalking-cli/display/displayable"
        "github.com/apache/skywalking-cli/graphql/common"
+       "github.com/apache/skywalking-cli/grpc"
 )
 
 var Command = cli.Command{
        Name:    "checkHealth",
        Aliases: []string{"ch"},
        Usage:   "Check the health status of OAP server",
+       Flags: []cli.Flag{
+               cli.BoolTFlag{
+                       Name:     "grpc",
+                       Usage:    "Check gRPC by HealthCheck service",
+                       Required: false,
+               },
+               cli.StringFlag{
+                       Name:     "grpcAddr",
+                       Usage:    "`host:port` to connect",
+                       Value:    "127.0.0.1:11800",
+                       Required: false,
+               },
+               cli.BoolFlag{
+                       Name:     "grpcTLS",
+                       Usage:    "use TLS for gRPC",
+                       Required: false,
+               },
+       },
        Action: func(ctx *cli.Context) error {
                healthStatus := common.CheckHealth(ctx)
-               return display.Display(ctx, &displayable.Displayable{Data: 
healthStatus})
+               if healthStatus.Score != 0 {
+                       return cli.NewExitError(healthStatus.Details, 
healthStatus.Score)
+               }
+               fmt.Println("OAP modules are healthy")

Review comment:
       Can we use the same logger as other commands so that the users can 
control what kind of logs to be displayed and the log format is consistent
   
   > and other `fmt.Println`, `fmt.Printf` in this PR




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to