Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Logging can be turned off.

  • Loading branch information...
commit 9908421dc4f69e06b39ed18dde6409fd596f2b34 1 parent 211e988
Jon Yurek authored December 30, 2008
5  lib/paperclip.rb
@@ -49,6 +49,8 @@ class << self
49 49
     # Provides configurability to Paperclip. There are a number of options available, such as:
50 50
     # * whiny_thumbnails: Will raise an error if Paperclip cannot process thumbnails of 
51 51
     #   an uploaded image. Defaults to true.
  52
+    # * log: Logs progress to the Rails log. Uses ActiveRecord's logger, so honors
  53
+    #   log levels, etc. Defaults to true.
52 54
     # * command_path: Defines the path at which to find the command line
53 55
     #   programs if they are not visible to Rails the system's search path. Defaults to 
54 56
     #   nil, which uses the first executable found in the user's search path.
@@ -57,7 +59,8 @@ def options
57 59
       @options ||= {
58 60
         :whiny_thumbnails  => true,
59 61
         :image_magick_path => nil,
60  
-        :command_path      => nil
  62
+        :command_path      => nil,
  63
+        :log               => true
61 64
       }
62 65
     end
63 66
 
6  lib/paperclip/attachment.rb
@@ -256,7 +256,11 @@ def logger
256 256
     end
257 257
 
258 258
     def log message
259  
-      logger.info("[paperclip] #{message}")
  259
+      logger.info("[paperclip] #{message}") if logging?
  260
+    end
  261
+
  262
+    def logging?
  263
+      Paperclip.options[:log]
260 264
     end
261 265
 
262 266
     def valid_assignment? file #:nodoc:

0 notes on commit 9908421

Please sign in to comment.
Something went wrong with that request. Please try again.