rubycas / rubycas-client

Ruby client for Yale's Central Authentication Service protocol -- an open source enterprise single sign on system for web applications.
http://code.google.com/p/rubycas-client/
Other
332 stars 217 forks source link

The LoggerWrapper initialize method is broken #84

Open matt-wratt opened 9 years ago

matt-wratt commented 9 years ago

There is no set_logger method on LoggerWrapper, set_logger should be set_real_logger. Currently when initializing the LoggerWrapper with a "real" logger, it will try to set the logger via the method_missing which will silently swallow the bug. https://github.com/rubycas/rubycas-client/blob/195a4b70333029be474b0ac70efdc85bd4288861/lib/casclient.rb#L50

Looks like there was an attempt to fix this in the past, but I suspect the fix highlighted other issues which were no-longer silently swallowed, but appeared to be brought about by the fix... https://github.com/rubycas/rubycas-client/commit/acd4f942480ee307d76a881673b9e180e7c48ddc

Although perhaps warnings were coming from the attempt to access the instance variable by use of the instance variable, instance_variable_defined?(@real_logger) should be instance_variable_defined?(:@real_logger). Perhaps the defined? method would be more appropriate here.