Module: ActiveRecord::Dbt::Configuration::Logger

Included in:
ActiveRecord::Dbt::Config
Defined in:
lib/active_record/dbt/configuration/logger.rb

Constant Summary collapse

DEFAULT_LOG_FILE_PATH =
'./log/active_record_dbt.log'
EXCLUDE_EXCEPTION_CLASS_NAMES =
%w[ArInternalMetadatum SchemaMigration].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject



12
13
14
# File 'lib/active_record/dbt/configuration/logger.rb', line 12

def logger
  @logger ||= ::Logger.new(DEFAULT_LOG_FILE_PATH)
end

Instance Method Details

#add_log(class_name, exception) ⇒ Object



16
17
18
19
20
# File 'lib/active_record/dbt/configuration/logger.rb', line 16

def add_log(class_name, exception)
  return if include_exception_class_names?(exception)

  logger.info(class_name) { format_log(exception) }
end