Module: Purview::Mixins::Logger

Included in:
Databases::Base, Loaders::Base, Parsers::Base, Pullers::Base, Pullers::BaseSQL, RawConnections::Base, Tables::Base
Defined in:
lib/purview/mixins/logger.rb

Instance Method Summary collapse

Instance Method Details

#loggerObject



4
5
6
# File 'lib/purview/mixins/logger.rb', line 4

def logger
 @logger ||= logger_type.new(logger_opts)
end

#logger_optsObject



8
9
10
# File 'lib/purview/mixins/logger.rb', line 8

def logger_opts
  (defined?(opts) && opts[:logger]) || {}
end

#logger_typeObject



12
13
14
# File 'lib/purview/mixins/logger.rb', line 12

def logger_type
  (defined?(opts) && opts[:logger_type]) || Purview::Loggers::Console
end

#with_context_logging(*args) ⇒ Object



16
17
18
# File 'lib/purview/mixins/logger.rb', line 16

def with_context_logging(*args)
  logger.with_context_logging(*args) { yield }
end