class Cassandra::Logger
This class is a logger that may be used by the client to log the driver's actions. It is a subclass of the standard Ruby Logger
class, so it is instantiated the same way.
The format of log output is set to include the timestamp, thread-id, log severity, and message. This format may change in newer versions of the driver to account for new/deprecated metadata.
@example Configuring {Cassandra::Cluster} to use a logger.
cluster = Cassandra.cluster(logger: Cassandra::Logger.new($stderr))
@example The log format may be changed the same way as in the standard Ruby Logger
class
logger = Cassandra::Logger.new($stderr) logger.formatter = proc { |severity, time, program_name, message| "[%s]: %s\n" % [severity, message] }
@example Create a logger and use it in your own business logic
logger = Cassandra::Logger.new($stderr) cluster = Cassandra.cluster(logger: logger) <various logic> logger.debug("something interesting happened.")
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
# File lib/cassandra/cassandra_logger.rb 75 def initialize(*args) 76 super(*args) 77 self.formatter = Formatter.new 78 end