-
Notifications
You must be signed in to change notification settings - Fork 616
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
undefined method log_level #292
Comments
that's probably a pretty hard change. this is mentioned in the changelog, but it's quite hidden. sorry. Savon.configure do |config|
config.logger.subject = Rails.logger
config.logger.level = :info
config.logger.filter << :password
end edit: please note that with v0.9.12, the log wrapper has been moved to |
I'm also having trouble with the new logger, but more particularly trying to turn logging off altogether. I went diving through the source but haven't figured out how to correctly do this yet. I am turning it off as it interrupts spec output in RSpec2 for a gem I'm building that's depending on Savon. I've tried numerous things including: Savon.configure do |config|
config.logger.subject = Savon::Logger.new("/dev/null")
end This isn't doing anything for me, however. Am I completely off track here? |
Hi Daniel, The removal of log_level should not have been made in a patch version, the public API has changed. Please use semantic versioning http://semver.org/spec/v1.0.0.html in the future. The documentation has not been updated. See the global configuration section here http://savonrb.com/ As a result of this change the Google ads api Ruby wrapper broke. http://code.google.com/p/google-api-ads-ruby/ Thank you for Savon. It is crucial to our business. Please let me know how we can help to make it even better. We can help. Rohit |
"Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable." The public API doesn't stabilize until major version 1. I think Daniel is still well within the Semantic Versioning bounds here. |
Sorry, I take that back and concede your point. The minor version change is for introducing new changes that are more than bug fixes. So, what @rohitn is saying is that it really should've been v0.10.0 to introduce new functionality. This would allow developers to use |
even though you "shouldn't expect" something 0.x to have a stable api, i totally agree with your point. i just released v0.9.12 which restores the |
Think this fix doesn't work properly: NoMethodError: undefined method `logger' for #Savon::Config:0x007fd2d5450d58 |
there's no logger method. you can access the log wrapper via |
I don't think anywhere in my code am I referring to logger though, it seems in the Savon config that is the default it is still trying to access logger? |
thanks. i don't have a stacktrace, but v0.9.13 should fix this. sorry again! |
btw. if this finally works and i don't get any other important issues, i'll release v1.0.0 with no changes to manifest the api. |
is 0.9.13 backward compatible with 0.9.11 then? I mean the logger stuff, I change my code yesterday to use the new logger and today it doesn't work :( I get your point about 0.xx versions and stable api. |
the log config should be mostly backward compatible with v0.9.9. this was and is the syntax: |
v0.9.13 didn't fix it, at least not for me, still 'log_level' undefined method. |
using 0.9.13 NameError: |
can you please post the complete stacktrace? |
0.9.13 stacktrace you asked for
|
yep. thanks. that should finally be fixed with v0.9.14. i yanked v0.9.12 and v0.9.13 to minimize the confusion. |
Ok, so I tried this: Savon.configure do |config|
config.log = false
end In my spec_helper.rb file with RSpec and I'm still getting all the debug output to STDOUT. This was working for me before so I'm not sure what I'm missing here. Is it possibly something with the new Logger class that changed the behavior here? |
there's a spec for that. which of the various versions are you using? |
The latest. I'll take a look at your example. |
Oh, actually, here's another interesting thing. I'm extending Savon::Model and I forgot that last night I considered this might not be properly affected by the global logger config setting. Is that possible? |
Well, it looks like it's supposed to clone the global config: def config
@config ||= Savon.config.clone
end So I suppose I'm off base there. |
when you're extending the model, the global config is memoized per extended class: let me know if there's something wrong with it. |
The Savon::Model code looks fine. I just can't figure out why I'm still getting log output even though I'm calling the configure block and setting log to false before my tests. It's just not adding up. |
I even tried adding: config.log = false to my class that's extending Savon::Model with no luck . . . |
This fixed my issue with logger after I updated my gem. I'm using it in On Thu, Jun 7, 2012 at 10:24 AM, Berrett Brothers <
|
the log config impl. for the model used two different configs. try changing the log level per class by accessing the config stored on the client instance: class User
extend Savon::Model
client.config.log = false
end |
Ok, I've got a Base class extending Savon::Model and then another class inheriting from my base class. If I drop that line in the Base class it does nothing for me. If I drop it in the child class it eliminates the log ouput. However, I was hoping to only eliminate this during my tests with one fell swoop on the global config. I will probably end up redirecting the output to my gem's own Logger implementation eventually but it's not implemented yet. I think we're getting somewhere though. |
Oh, I just realized that you removed that in the patch you mentioned. Not in a new version of the gem yet though, correct? |
yep. didn't want to release yet another version until someone tested against master. |
Ah, I see. I can pull from master this afternoon or evening and test with my project to see how it works. Thanks. |
thank you! |
I haven't tested the latest code from master but it looks like the original issue I had is now resolved in new google-ads-common 0.7.2 released today. I have tested against 0.9.11 and it works fine. I am not getting the same error anymore. http://code.google.com/p/google-api-ads-ruby/issues/detail?id=75&can=1&sort=-id |
great. closing this issue cause every bug seems to be fixed. |
Thanks for your help. |
why log_level method is removed from config.rb.
NoMethodError:
undefined method `log_level=' for #Savon::Config:0x4f18179d
The text was updated successfully, but these errors were encountered: