Class: Module
Instance Method Summary collapse
-
#log ⇒ Object
Returns the Log for this
Module
(orClass
).
Instance Method Details
#log ⇒ Object
Returns the Log for this Module
(or Class
)
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/safis/logging/automagic.rb', line 26 def log if ( not instance_variable_defined? :@log ) then # If we're Object, we're top 'o the chain and want to send our events to the default formatter parent = nil if ( self != Object ) then scope_position = name.rindex('::') parent_constant = (scope_position) ? eval(name[0...scope_position]) : Object parent = parent_constant.log end @log = Safis::Logging::Log.new(name, parent) end @log end |