Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added optional request and response logging #6

Closed
wants to merge 9 commits into from
2 changes: 1 addition & 1 deletion helix.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func NewClient(options *Options) (*Client, error) {

// Use the default logger, if none was set by the user.
if options.Logger == nil {
c.Logger = &log.Logger{}
c.logger = &log.Logger{}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to set the default output here. If we don't, calling c.logger.Printf will throw an error.

By default I think we should just use stdout. For example:

c.logger = log.New(os.Stdout, "Helix: ", log.LstdFlags)

See the docs for log.New.

}

if options.HTTPClient != nil {
Expand Down