Skip to content

Commit

Permalink
Harmonize log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
stv0g committed Jun 24, 2023
1 parent 3191ed9 commit e56f1f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/stun-client/stun_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func main() {

uri, err := stun.ParseURI(uriStr)
if err != nil {
log.Fatalf("invalid URI '%s': %s", uriStr, err)
log.Fatalf("Invalid URI '%s': %s", uriStr, err)
}

// we only try the first address, so restrict ourselves to IPv4
Expand All @@ -47,7 +47,7 @@ func main() {

log.Print(xorAddr)
}); err != nil {
log.Fatal("do:", err)
log.Fatal("Do:", err)
}
if err := c.Close(); err != nil {
log.Fatalf("Failed to close connection: %s", err)
Expand Down
8 changes: 4 additions & 4 deletions cmd/stun-nat-behaviour/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func main() {
func mappingTests(addrStr string) error {
mapTestConn, err := connect(addrStr)
if err != nil {
log.Warnf("Error creating STUN connection: %s", err.Error())
log.Warnf("Error creating STUN connection: %s", err)
return err
}

Expand Down Expand Up @@ -147,7 +147,7 @@ func mappingTests(addrStr string) error {
func filteringTests(addrStr string) error {
mapTestConn, err := connect(addrStr)
if err != nil {
log.Warnf("Error creating STUN connection: %s", err.Error())
log.Warnf("Error creating STUN connection: %s", err)
return err
}

Expand Down Expand Up @@ -254,10 +254,10 @@ func parse(msg *stun.Message) (ret struct {

// Given an address string, returns a StunServerConn
func connect(addrStr string) (*stunServerConn, error) {
log.Infof("connecting to STUN server: %s", addrStr)
log.Infof("Connecting to STUN server: %s", addrStr)
addr, err := net.ResolveUDPAddr("udp4", addrStr)
if err != nil {
log.Warnf("Error resolving address: %s", err.Error())
log.Warnf("Error resolving address: %s", err)
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/testutil/allocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ func ShouldNotAllocate(t *testing.T, f func()) {
return
}
if a := testing.AllocsPerRun(10, f); a > 0 {
t.Errorf("allocations detected: %f", a)
t.Errorf("Allocations detected: %f", a)
}
}

0 comments on commit e56f1f8

Please sign in to comment.