Skip to content

Commit

Permalink
Enable unit bridge debug only for debug log levels.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoga committed May 18, 2024
1 parent ac94e4d commit c30c97b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ func new(l *logger.Logger, appID uint64, typ connection.Type,
return nil, fmt.Errorf("robot module is required")
}

ub := unitybridge.Get(wrapper.Get(l), true, l)
// Enable Unity Bridge debug logging if the logger level is debug.
unityBridgeDebugEnabled := l.Level() == slog.LevelDebug

ub := unitybridge.Get(wrapper.Get(l), unityBridgeDebugEnabled, l)

cn, err := connection.New(ub, l, appID, typ)
if err != nil {
Expand Down

0 comments on commit c30c97b

Please sign in to comment.