Skip to content

Commit

Permalink
Too much logging.
Browse files Browse the repository at this point in the history
This polutes the development logs and generates massive log files in
test mode on Rails. The gem already provides enough API to debug and
solve invalid templates, so all of this is very much extra.
  • Loading branch information
stas committed Nov 7, 2020
1 parent c5cf39f commit 74232a8
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lib/mjml/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class ExecutableNotFound < StandardError; end
ROOT_TAGS_REGEX = %r{<mjml.*>.*<\/mjml>}im

def initialize
MJML.logger.debug("Path: #{mjml_bin};" \
"Version: #{MJML.executable_version}")
raise ExecutableNotFound if MJML.executable_version.nil?
end

Expand All @@ -28,16 +26,13 @@ def call!(template)
private

def exec!
MJML.logger.debug("Template:\n #{@template}")
raise InvalidTemplate if @template.empty?

MJML.logger.debug("Partial: #{partial?}")
return @template if partial?

out, err = should_get_outpout_from_file? ? output_from_file : output_from_memory
parsed = parse_output(out)

MJML.logger.debug("Output:\n #{parsed[:output]}")
MJML.logger.error(err) unless err.empty?
MJML.logger.warn(parsed[:warnings]) unless parsed[:warnings].empty?

Expand Down

0 comments on commit 74232a8

Please sign in to comment.