Module: Pundit::Logger::Logging

Included in:
Pundit::Logger
Defined in:
lib/pundit_logger/logging.rb

Instance Method Summary collapse

Instance Method Details

#log(message) ⇒ Object

Logs a message to the logger configured in Pundit::Logger.logger.

Uses tagged logging, if configured using Pundit::Logger.logger_tag

Parameters:

  • Message (String)

    to write to the logger



11
12
13
14
15
16
17
18
19
# File 'lib/pundit_logger/logging.rb', line 11

def log(message)
  if logger.respond_to?(:tagged) && logger_tag
    logger.tagged(logger_tag) do
      write_message message
    end
  else
    write_message message
  end
end