Skip to content

Commit

Permalink
Changed debug to proper info logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Utkarsh Shukla committed Dec 3, 2024
1 parent 657e26f commit 6fbd098
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"flag"
"fmt"
"io"
"log"
"net/http"
pprofhttp "net/http/pprof"
"os"
Expand Down Expand Up @@ -139,7 +138,7 @@ func waitForRequest(ctx context.Context, c pb.TunnelServiceClient) error {
if req.IsKeepalive {
continue
}
logger.Debugw("waitForRequest response",
logger.Info("waitForRequest response",
"streamID", req.StreamId,
"method", req.Method,
"serviceName", req.Name,
Expand All @@ -153,7 +152,7 @@ func waitForRequest(ctx context.Context, c pb.TunnelServiceClient) error {
ep, found := findEndpoint(ctx, req.Name, req.Type)
if !found {
if err := echo.Fail(ctx, http.StatusBadGateway, fmt.Errorf("no such service on agent")); err != nil {
logger.Warn(err)
logger.Info(err)
}
echo.Shutdown(ctx)
continue
Expand All @@ -163,7 +162,7 @@ func waitForRequest(ctx context.Context, c pb.TunnelServiceClient) error {
go pprof.Do(ctx, labels, func(ctx context.Context) {
defer echo.Shutdown(ctx)
if err := ep.Instance.ExecuteHTTPRequest(ctx, session.agentID, echo, req); err != nil {
logger.Warn(err)
logger.Info(err)
}
})
}
Expand Down Expand Up @@ -458,13 +457,13 @@ func main() {

go func() {
err := waitForRequest(ctx, c)
log.Printf("waitForRequest failed: %v", err)
logger.Info("waitForRequest failed: %v", err)
session.done <- struct{}{}
}()

go func() {
err := pinger(ctx, c, *tickTime)
log.Printf("pinger failed: %v", err)
logger.Info("pinger failed: %v", err)
session.done <- struct{}{}
}()

Expand Down

0 comments on commit 6fbd098

Please sign in to comment.