hensei-api/lib/logging_helper.rb
Justin Edmund d71b78e5f8
Update post-deploy script and Rails credentials (#155)
* Fresh credentials.yml.enc

* Update .ruby-gemset

* Made PostDeploymentManager modular

We broke PostDeploymentManager out into several files to make it easier to maintain.

We also added a "force" mode that forces the script to consider all CSV files. This is useful for testing the post-deploy script itself. This should only be used in test mode or you will dirty your database.

We also fine tuned some of the logging to make sure that both verbose and non-verbose modes are helpful.
2025-01-15 14:56:38 -08:00

33 lines
691 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