Class: Hanami::Providers::Logger Private
- Inherits:
-
Hanami::Provider::Source
- Object
- Dry::System::Provider::Source
- Hanami::Provider::Source
- Hanami::Providers::Logger
- Defined in:
- lib/hanami/providers/logger.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Provider source to register logger component in Hanami slices.
Instance Attribute Summary
Attributes inherited from Hanami::Provider::Source
Instance Method Summary collapse
-
#logger ⇒ Dry::Logger::Dispatcher
Returns the logger instance that will be registered as the slice's
"logger"component. - #start ⇒ Object private
Methods inherited from Hanami::Provider::Source
#initialize, #target_container
Constructor Details
This class inherits a constructor from Hanami::Provider::Source
Instance Method Details
#logger ⇒ Dry::Logger::Dispatcher
Returns the logger instance that will be registered as the slice's "logger" component.
This is memoized, so lifecycle callbacks added when extending the provider via
Slice::ClassMethods#configure_provider (such as a before :start or after :start
hook) can access and customize the very same logger that start registers — for example, to
add a logging backend.
30 31 32 |
# File 'lib/hanami/providers/logger.rb', line 30 def logger @logger ||= Hanami.app.config.logger_instance end |
#start ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 |
# File 'lib/hanami/providers/logger.rb', line 14 def start register :logger, logger end |