Skip to content

Commit

Permalink
sample refactor using log package.
Browse files Browse the repository at this point in the history
  • Loading branch information
sudiptob2 committed Jun 10, 2024
1 parent 5308cf9 commit 0485127
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion internal/webservice/webservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"context"
"encoding/json"
"fmt"

"github.com/G-Research/yunikorn-history-server/log"
"net/http"
"os"
"time"
Expand Down Expand Up @@ -65,7 +67,7 @@ func (ws *WebService) Start(ctx context.Context) {
})
ws.server.Handler = router
go func() {
fmt.Printf("Starting webservice on %s\n", ws.server.Addr)
log.Logger.Info(fmt.Sprintf("Starting webservice on %s", ws.server.Addr))
err := ws.server.ListenAndServe()
if err != nil && err != http.ErrServerClosed {
fmt.Fprintf(os.Stderr, "HTTP serving error: %v\n", err)
Expand Down
4 changes: 3 additions & 1 deletion internal/ykclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"net/http"
"os"

"github.com/G-Research/yunikorn-history-server/log"

"github.com/google/uuid"

"github.com/G-Research/yunikorn-history-server/internal/config"
Expand Down Expand Up @@ -47,7 +49,7 @@ func (c *Client) Run(ctx context.Context) {
}

go func() {
fmt.Println("Starting YuniKorn event stream client")
log.Logger.Info("Starting YuniKorn event stream client")
c.FetchEventStream(ctx, streamURL, evCounts)
}()
}
Expand Down

0 comments on commit 0485127

Please sign in to comment.