controlclient: handle nil Logf option

This commit is contained in:
David Crawshaw 2020-02-11 15:08:07 -05:00
parent ea11d58e96
commit 2b947b3b40
1 changed files with 3 additions and 0 deletions

View File

@ -142,6 +142,9 @@ func NewNoStart(opts Options) (*Client, error) {
if err != nil {
return nil, err
}
if opts.Logf == nil {
opts.Logf = func(fmt string, args ...interface{}) {}
}
c := &Client{
direct: direct,
timeNow: opts.TimeNow,