Module: Dragonfly::Loggable

Included in:
FunctionManager, ImageMagick::Utils, Server
Defined in:
lib/dragonfly/loggable.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) log_object (readonly)

Returns the value of attribute log_object



21
22
23
# File 'lib/dragonfly/loggable.rb', line 21

def log_object
  @log_object
end

Instance Method Details

- (Object) log



6
7
8
9
10
11
12
13
14
15
# File 'lib/dragonfly/loggable.rb', line 6

def log
  case @log_object
  when nil
    @log_object = Logger.new($stdout)
  when Proc
    @log_object[]
  when Logger
    @log_object
  end
end

- (Object) log=(object)



17
18
19
# File 'lib/dragonfly/loggable.rb', line 17

def log=(object)
  @log_object = object
end

- (Object) use_same_log_as(object)



23
24
25
# File 'lib/dragonfly/loggable.rb', line 23

def use_same_log_as(object)
  self.log = proc{ object.log }
end