Class: Hanami::Providers::DBLogging Private

Inherits:
Hanami::Provider::Source show all
Defined in:
lib/hanami/providers/db_logging.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.

Since:

  • 2.2.0

Instance Attribute Summary

Attributes inherited from Hanami::Provider::Source

#slice

Instance Method Summary collapse

Methods inherited from Hanami::Provider::Source

#initialize, #target_container

Constructor Details

This class inherits a constructor from Hanami::Provider::Source

Instance Method Details

#prepareObject

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.

Since:

  • 2.2.0



7
8
9
# File 'lib/hanami/providers/db_logging.rb', line 7

def prepare
  slice["notifications"].register_event :sql
end

#startObject

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.

Since:

  • 2.2.0



11
12
13
14
15
16
# File 'lib/hanami/providers/db_logging.rb', line 11

def start
  require "hanami/logger/sql_logger"
  Hanami::Logger::SQLLogger
    .new(slice["logger"], level: slice.config.db.log_level)
    .subscribe(slice["notifications"])
end