Commit 9908421d by Jon Yurek

Logging can be turned off.

parent 211e9883
...@@ -49,6 +49,8 @@ module Paperclip ...@@ -49,6 +49,8 @@ module Paperclip
# Provides configurability to Paperclip. There are a number of options available, such as: # Provides configurability to Paperclip. There are a number of options available, such as:
# * whiny_thumbnails: Will raise an error if Paperclip cannot process thumbnails of # * whiny_thumbnails: Will raise an error if Paperclip cannot process thumbnails of
# an uploaded image. Defaults to true. # an uploaded image. Defaults to true.
# * log: Logs progress to the Rails log. Uses ActiveRecord's logger, so honors
# log levels, etc. Defaults to true.
# * command_path: Defines the path at which to find the command line # * command_path: Defines the path at which to find the command line
# programs if they are not visible to Rails the system's search path. Defaults to # programs if they are not visible to Rails the system's search path. Defaults to
# nil, which uses the first executable found in the user's search path. # nil, which uses the first executable found in the user's search path.
...@@ -57,7 +59,8 @@ module Paperclip ...@@ -57,7 +59,8 @@ module Paperclip
@options ||= { @options ||= {
:whiny_thumbnails => true, :whiny_thumbnails => true,
:image_magick_path => nil, :image_magick_path => nil,
:command_path => nil :command_path => nil,
:log => true
} }
end end
......
...@@ -256,7 +256,11 @@ module Paperclip ...@@ -256,7 +256,11 @@ module Paperclip
end end
def log message def log message
logger.info("[paperclip] #{message}") logger.info("[paperclip] #{message}") if logging?
end
def logging?
Paperclip.options[:log]
end end
def valid_assignment? file #:nodoc: def valid_assignment? file #:nodoc:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment