Skip to content

Commit

Permalink
fix: requestId is not readable
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuRunzhi committed Jul 12, 2022
1 parent 33c2a72 commit 22e2025
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ import (
"context"
"errors"
"fmt"
"github.com/nats-io/nuid"
"os"
"reflect"
"runtime/debug"
"strconv"

"github.com/nats-io/nuid"

"github.com/topfreegames/pitaya/v2/conn/message"
"github.com/topfreegames/pitaya/v2/constants"
pcontext "github.com/topfreegames/pitaya/v2/context"
Expand Down Expand Up @@ -174,10 +175,10 @@ func CtxWithDefaultLogger(ctx context.Context, route, userID string) context.Con
requestID := pcontext.GetFromPropagateCtx(ctx, constants.RequestIDKey)
if rID, ok := requestID.(string); ok {
if rID == "" {
requestID = nuid.New()
requestID = nuid.New().Next()
}
} else {
requestID = nuid.New()
requestID = nuid.New().Next()
}
defaultLogger := logger.Log.WithFields(
map[string]interface{}{
Expand Down

0 comments on commit 22e2025

Please sign in to comment.