I define a class:
class BuildLogger
@@build_logger=nil
def self.get_build_logger(file_name=nil)
if @@build_logger == nil ###this line will thrown an error
@@build_logger=Logger.new("build_logger")
@@build_logger.level = DEBUG
end
return @@build_logger
end
end
I invoke BuildLogger.get_build_logger in a controller. An error "Called
id for nil, which would mistakenly be 4 -- if you really wanted the id
of nil, use object_id" is always thrown on the "if" line. I have
no idea
about this error. does anyone know this problem?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---