You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
701 B

require 'dotenv'
# Development Constants
module LiveConstants
HOT = {} # rubocop:disable Style/MutableConstant
LOGGER = SemanticLogger[to_s]
class << self
def stimulus_debug = load_boolean('STIMULUS_DEBUG', false)
def log_active_record = load_boolean('LOG_ACTIVE_RECORD', true)
def log_action_view = load_boolean('LOG_ACTION_VIEW', true)
def load_boolean(key, default) = HOT.fetch(key, default).to_s.downcase == 'true'
def reload!
HOT.replace Dotenv.parse
# LOGGER.warn 'reloaded!'
ActiveRecord::Base.logger.level = log_active_record ? :debug : :fatal
ActionView::Base.logger.level = log_action_view ? :debug : :fatal
end
end
reload!
end