hensei-api/lib/logging_helper.rb
Justin Edmund 52f213d4cb
Update importer (#160)
* Importer now displays validation errors

This will help people debug errors before submitting their PR.

* Fix errors in the outstanding updates
2025-01-15 17:46:14 -08:00

33 lines
687 B
Ruby

# frozen_string_literal: true
module LoggingHelper
def log_step(message)
puts message
end
def log_verbose(message)
print message if @verbose
end
def log_error(message)
puts "#{message}"
end
def log_warning(message)
puts "⚠️ #{message}"
end
def log_divider(character = '+', leading_newline = true, trailing_newlines = 1)
output = ""
output += "\n" if leading_newline
output += character * 60
output += "\n" * trailing_newlines
log_step output
end
def log_header(title, character = '+', leading_newline = true)
log_divider(character, leading_newline, 0)
log_step title
log_divider(character, false)
end
end