Module: Paperclip::Logger

Included in:
Paperclip
Defined in:
lib/paperclip/logger.rb

Instance Method Summary collapse

Instance Method Details

#log(message) ⇒ Object

Log a paperclip-specific line. This will log to STDOUT by default. Set Paperclip.options to false to turn off.



5
6
7
# File 'lib/paperclip/logger.rb', line 5

def log(message)
  logger.info("[paperclip] #{message}") if logging?
end

#loggerObject

:nodoc:



9
10
11
# File 'lib/paperclip/logger.rb', line 9

def logger #:nodoc:
  @logger ||= options[:logger] || ::Logger.new(STDOUT)
end

#logger=(logger) ⇒ Object



13
14
15
# File 'lib/paperclip/logger.rb', line 13

def logger=(logger)
  @logger = logger
end

#logging?Boolean

:nodoc:

Returns:

  • (Boolean)


17
18
19
# File 'lib/paperclip/logger.rb', line 17

def logging? #:nodoc:
  options[:log]
end