Skip to content

Commit e56f1f8

Browse files
committed
Harmonize log messages
1 parent 3191ed9 commit e56f1f8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

cmd/stun-client/stun_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func main() {
2727

2828
uri, err := stun.ParseURI(uriStr)
2929
if err != nil {
30-
log.Fatalf("invalid URI '%s': %s", uriStr, err)
30+
log.Fatalf("Invalid URI '%s': %s", uriStr, err)
3131
}
3232

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

4848
log.Print(xorAddr)
4949
}); err != nil {
50-
log.Fatal("do:", err)
50+
log.Fatal("Do:", err)
5151
}
5252
if err := c.Close(); err != nil {
5353
log.Fatalf("Failed to close connection: %s", err)

cmd/stun-nat-behaviour/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func main() {
7474
func mappingTests(addrStr string) error {
7575
mapTestConn, err := connect(addrStr)
7676
if err != nil {
77-
log.Warnf("Error creating STUN connection: %s", err.Error())
77+
log.Warnf("Error creating STUN connection: %s", err)
7878
return err
7979
}
8080

@@ -147,7 +147,7 @@ func mappingTests(addrStr string) error {
147147
func filteringTests(addrStr string) error {
148148
mapTestConn, err := connect(addrStr)
149149
if err != nil {
150-
log.Warnf("Error creating STUN connection: %s", err.Error())
150+
log.Warnf("Error creating STUN connection: %s", err)
151151
return err
152152
}
153153

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

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

internal/testutil/allocs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ func ShouldNotAllocate(t *testing.T, f func()) {
1515
return
1616
}
1717
if a := testing.AllocsPerRun(10, f); a > 0 {
18-
t.Errorf("allocations detected: %f", a)
18+
t.Errorf("Allocations detected: %f", a)
1919
}
2020
}

0 commit comments

Comments
 (0)