我正在尝试编写自己的回形针处理器,但是我应该如何登录到回形针记录器?
我尝试了以下操作,日志“这里是处理器”
没有输出任何内容。我该怎么做?
module Paperclip
class MyProcessor < Processor
include Paperclip::Logger
def initialize(file, options = {}, attachment = nil)
super
@format = options[:format]
@current_format = File.extname(@file.path)
@basename = File.basename(@file.path, @current_format)
end
def make
log 'here is the processor'
end
end
end
最佳答案
如果您的处理器需要记录日志,则日志方法是 Paperclip 模块的一部分
Paperclip.log "Log something"
https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/logger.rb
关于ruby-on-rails-3 - 回形针处理器 - 如何在我自己的处理器中使用回形针记录器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10527589/