Skip to content

Commit

Permalink
Fix log statements
Browse files Browse the repository at this point in the history
Summary:
1. No need for `.String()` - `%s` verb will call it automatically.
2. New lines were missing.

Reviewed By: awalterschulze, lcpoletto

Differential Revision: D64496347

fbshipit-source-id: 4047f3ad80270c11ea3b046ac44e1892228ec4c1
  • Loading branch information
echistyakov authored and facebook-github-bot committed Oct 18, 2024
1 parent 14029d5 commit 04141e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (p *headerServer) acceptLoop(ctx context.Context) error {
go func(ctx context.Context, conn net.Conn) {
ctx = p.connContext(ctx, conn)
if err := p.processRequests(ctx, conn); err != nil {
p.log.Printf("error processing request from %s: %s", conn.RemoteAddr().String(), err)
p.log.Printf("error processing request from %s: %s\n", conn.RemoteAddr(), err)
}
}(ctx, conn)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,28 +107,28 @@ func (r *rocketServerTransport) processRequests(ctx context.Context, conn net.Co
processor := newRocketUpgradeProcessor(r.processor)
headerProtocol, err := NewHeaderProtocol(conn)
if err != nil {
r.log.Printf("thrift: error constructing header protocol from %s: %s", conn.RemoteAddr().String(), err)
r.log.Printf("thrift: error constructing header protocol from %s: %s\n", conn.RemoteAddr(), err)
return
}
if err := r.processHeaderRequest(ctx, headerProtocol, processor); err != nil {
r.log.Printf("thrift: error processing request from %s: %s", conn.RemoteAddr().String(), err)
r.log.Printf("thrift: error processing request from %s: %s\n", conn.RemoteAddr(), err)
return
}
if processor.upgraded {
r.processRocketRequests(ctx, conn)
} else {
if err := r.processHeaderRequests(ctx, headerProtocol, processor); err != nil {
r.log.Printf("thrift: error processing request from %s: %s", conn.RemoteAddr().String(), err)
r.log.Printf("thrift: error processing request from %s: %s\n", conn.RemoteAddr(), err)
}
}
case TransportIDHeader:
headerProtocol, err := NewHeaderProtocol(conn)
if err != nil {
r.log.Printf("thrift: error constructing header protocol from %s: %s", conn.RemoteAddr().String(), err)
r.log.Printf("thrift: error constructing header protocol from %s: %s\n", conn.RemoteAddr(), err)
return
}
if err := r.processHeaderRequests(ctx, headerProtocol, r.processor); err != nil {
r.log.Printf("thrift: error processing request from %s: %s", conn.RemoteAddr().String(), err)
r.log.Printf("thrift: error processing request from %s: %s\n", conn.RemoteAddr(), err)
}
}
}
Expand Down

0 comments on commit 04141e3

Please sign in to comment.