Skip to content

Commit 970251f

Browse files
committed
Add logging to ImageMagickProcessor
1 parent af3e2d5 commit 970251f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/grim/image_magick_processor.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,18 @@ def save(pdf, index, path, options)
4848
command_env['PATH'] = "#{File.dirname(@ghostscript_path)}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
4949
end
5050

51-
result, status = Open3.capture2e(command_env, command.join(' '))
51+
log(command_env, command)
52+
result, status = Open3.capture2e(command_env, command.join(" "))
5253

5354
status.success? || raise(UnprocessablePage, result)
5455
end
56+
57+
def log(command_env, command)
58+
Grim.logger.debug "Running imagemagick command"
59+
if command_env.any?
60+
Grim.logger.debug command_env.map {|k,v| "#{k}=#{v}" }.join(" ")
61+
end
62+
Grim.logger.debug command.join(" ")
63+
end
5564
end
5665
end

0 commit comments

Comments
 (0)