Module: Mongo::Loggable
- Included in:
- Client, Cluster, Cluster::Topology::ReplicaSet, Cluster::Topology::Unknown, Collection::View::Aggregation, Collection::View::MapReduce, Monitoring::CommandLogSubscriber, Server::ConnectionPool, Server::Monitor, URI
- Defined in:
- lib/mongo/loggable.rb
Overview
Allows objects to easily log operations.
Constant Summary collapse
- PREFIX =
The standard MongoDB log prefix.
'MONGODB'.freeze
Instance Method Summary collapse
-
#log_debug(message) ⇒ Object
Convenience method to log debug messages with the standard prefix.
-
#log_error(message) ⇒ Object
Convenience method to log error messages with the standard prefix.
-
#log_fatal(message) ⇒ Object
Convenience method to log fatal messages with the standard prefix.
-
#log_info(message) ⇒ Object
Convenience method to log info messages with the standard prefix.
-
#log_warn(message) ⇒ Object
Convenience method to log warn messages with the standard prefix.
-
#logger ⇒ Logger
Get the logger instance.
Instance Method Details
#log_debug(message) ⇒ Object
Convenience method to log debug messages with the standard prefix.
35 36 37 |
# File 'lib/mongo/loggable.rb', line 35 def log_debug() logger.debug(()) if logger.debug? end |
#log_error(message) ⇒ Object
Convenience method to log error messages with the standard prefix.
47 48 49 |
# File 'lib/mongo/loggable.rb', line 47 def log_error() logger.error(()) if logger.error? end |
#log_fatal(message) ⇒ Object
Convenience method to log fatal messages with the standard prefix.
59 60 61 |
# File 'lib/mongo/loggable.rb', line 59 def log_fatal() logger.fatal(()) if logger.fatal? end |
#log_info(message) ⇒ Object
Convenience method to log info messages with the standard prefix.
71 72 73 |
# File 'lib/mongo/loggable.rb', line 71 def log_info() logger.info(()) if logger.info? end |
#log_warn(message) ⇒ Object
Convenience method to log warn messages with the standard prefix.
83 84 85 |
# File 'lib/mongo/loggable.rb', line 83 def log_warn() logger.warn(()) if logger.warn? end |