Skip to content

Commit

Permalink
benchmark: Log TChannel warnings (or higher) to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
prashantv committed Jun 22, 2016
1 parent e978a5a commit 2dc86c1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion benchmark/internal_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package benchmark
import (
"bytes"
"fmt"
"os"
"time"

"github.com/uber/tchannel-go"
Expand Down Expand Up @@ -66,7 +67,9 @@ func newClient(hosts []string, opts *options) inProcClient {
}

func newInternalClient(hosts []string, opts *options) inProcClient {
ch, err := tchannel.NewChannel(opts.svcName, nil)
ch, err := tchannel.NewChannel(opts.svcName, &tchannel.ChannelOptions{
Logger: tchannel.NewLevelLogger(tchannel.NewLogger(os.Stderr), tchannel.LogLevelWarn),
})
if err != nil {
panic("failed to create channel: " + err.Error())
}
Expand Down
5 changes: 4 additions & 1 deletion benchmark/internal_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package benchmark

import (
"fmt"
"os"

"github.com/uber/tchannel-go"
"github.com/uber/tchannel-go/hyperbahn"
Expand All @@ -48,7 +49,9 @@ func NewServer(optFns ...Option) Server {
return newExternalServer(opts)
}

ch, err := tchannel.NewChannel(opts.svcName, nil)
ch, err := tchannel.NewChannel(opts.svcName, &tchannel.ChannelOptions{
Logger: tchannel.NewLevelLogger(tchannel.NewLogger(os.Stderr), tchannel.LogLevelWarn),
})
if err != nil {
panic("failed to create channel: " + err.Error())
}
Expand Down
3 changes: 3 additions & 0 deletions benchmark/real_relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
package benchmark

import (
"os"

"github.com/uber/tchannel-go"
"github.com/uber/tchannel-go/relay"

Expand Down Expand Up @@ -52,6 +54,7 @@ func NewRealRelay(services map[string][]string) (Relay, error) {
hosts := &fixedHosts{hosts: services}
ch, err := tchannel.NewChannel("relay", &tchannel.ChannelOptions{
RelayHosts: hosts,
Logger: tchannel.NewLevelLogger(tchannel.NewLogger(os.Stderr), tchannel.LogLevelWarn),
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 2dc86c1

Please sign in to comment.