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

The :log option treats nil as truthy rather than falsy #379

Closed
wconrad opened this issue Jan 25, 2013 · 5 comments
Closed

The :log option treats nil as truthy rather than falsy #379

wconrad opened this issue Jan 25, 2013 · 5 comments
Milestone

Comments

@wconrad
Copy link

wconrad commented Jan 25, 2013

The :log option to Savon.client enables logging when it is "truthy" (that is, neither false nor nil):

Savon.client(:log => true)    # logging enabled
Savon.client(:log => 1)    # logging enabled

When passing in "falsy" (either false or nil), however, the result is surprising for nil, where logging is enabled rather than disabled:

Savon.client(:log => false)    # logging disabled
Savon.client(:log => nil)    # surprise! logging enabled

This is with savon 2.0.3

@rubiii
Copy link
Contributor

rubiii commented Jan 26, 2013

thanks for reporting this! the logging code was refactored after 2.0.3 and after checking the code on master,
i can confirm that this has been fixed. should be included in 2.1.0 soon.

@rubiii rubiii closed this as completed Jan 26, 2013
@wconrad
Copy link
Author

wconrad commented Jan 28, 2013

Thank you, Rubiii.

@rubiii
Copy link
Contributor

rubiii commented Feb 3, 2013

released v2.1.0. please refer to the updated changelog and documentation for details. let me know how it works!

@wconrad
Copy link
Author

wconrad commented Feb 3, 2013

rubiii, Thanks! It works mostly. Most debug output is now suppressed when passing in nil, but lines of this format are still output:

D, [2013-02-03T06:42:53.962598 #28824] DEBUG -- : HTTPI GET request to epf.usps.gov (net_http)
D, [2013-02-03T06:42:54.223903 #28824] DEBUG -- : HTTPI POST request to epf.usps.gov (net_http)
D, [2013-02-03T06:42:54.505215 #28824] DEBUG -- : HTTPI POST request to epf.usps.gov (net_http)
D, [2013-02-03T06:42:54.751633 #28824] DEBUG -- : HTTPI POST request to epf.usps.gov (net_http)

Do you want me to open up a separate issue for it?

@rubiii
Copy link
Contributor

rubiii commented Feb 3, 2013

this log output actually comes from httpi and you can disable it via:

HTTPI.log = false

we're currently discussing this at #375.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants