Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

fix: use zero'd logger for Dial when no logger is passed #430

Merged
merged 1 commit into from
Sep 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions wsnet/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"io"
"net"
"net/url"
"os"
"sync"
"time"

Expand All @@ -18,7 +17,6 @@ import (
"nhooyr.io/websocket"

"cdr.dev/slog"
"cdr.dev/slog/sloggers/sloghuman"

"cdr.dev/coder-cli/coder-sdk"
)
Expand Down Expand Up @@ -83,8 +81,7 @@ func Dial(ctx context.Context, conn net.Conn, options *DialOptions) (*Dialer, er
options = &DialOptions{}
}
if options.Log == nil {
log := slog.Make(sloghuman.Sink(os.Stderr)).Leveled(slog.LevelInfo).Named("wsnet_dial")
options.Log = &log
options.Log = &slog.Logger{}
}
log := *options.Log
if options.ICEServers == nil {
Expand Down