Skip to content

Commit d0ee83d

Browse files
authored
Log only if logger is set (#53)
1 parent 1ac33a1 commit d0ee83d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

generate/go_client.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ func New(config *DialConfig) (Client, error) {
7575
if config.Token != "" {
7676
c.interceptors = append(c.interceptors, authInterceptor)
7777
}
78-
c.interceptors = append(c.interceptors, loggingInterceptor)
78+
if config.Log != nil {
79+
c.interceptors = append(c.interceptors, loggingInterceptor)
80+
}
7981
c.interceptors = append(c.interceptors, config.Interceptors...)
8082

8183
go c.startTokenRenewal()

go/client/client.go

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)