Class: Cequel::Metal::ExceptionLogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/cequel/metal/logger.rb

Overview

Logger for queries that resulted in an exception

Since:

  • 1.0.0

Instance Attribute Summary

Attributes inherited from Logger

#out, #severity, #threshold

Instance Method Summary collapse

Methods inherited from Logger

#initialize

Constructor Details

This class inherits a constructor from Cequel::Metal::Logger

Instance Method Details

#log(label, statement, bind_vars) ⇒ void

This method returns an undefined value.

Log a CQL statement that resulted in an exception

Parameters:

  • label (String)

    a logical label for this statement

  • statement (String)

    the CQL statement to log

  • bind_vars (Array)

    bind variables for the CQL statement

Since:

  • 1.0.0



64
65
66
67
68
# File 'lib/cequel/metal/logger.rb', line 64

def log(label, statement, bind_vars)
  out.add(severity) do
    sprintf('%s (ERROR) %s', label, sanitize(statement, bind_vars))
  end
end