Module: Mongo::Loggable
- Included in:
- Auth::User, BackgroundThread, Client, Cluster, Cluster::Topology::Base, Collection::View::Aggregation::Behavior, Collection::View::MapReduce, Monitoring::CmapLogSubscriber, Monitoring::CommandLogSubscriber, Monitoring::Publishable, Monitoring::SDAMLogSubscriber, Monitoring::UnifiedSdamLogSubscriber, Server::ConnectionPool, Server::Monitor, Server::Monitor::Connection, Session, Socket::OcspVerifier, Srv::Monitor, Srv::Resolver, URI, URI::OptionsMapper, Utils::LocalLogger
- 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.
38 39 40 |
# File 'lib/mongo/loggable.rb', line 38 def log_debug() logger.debug(()) if logger.debug? end |
#log_error(message) ⇒ Object
Convenience method to log error messages with the standard prefix.
50 51 52 |
# File 'lib/mongo/loggable.rb', line 50 def log_error() logger.error(()) if logger.error? end |
#log_fatal(message) ⇒ Object
Convenience method to log fatal messages with the standard prefix.
62 63 64 |
# File 'lib/mongo/loggable.rb', line 62 def log_fatal() logger.fatal(()) if logger.fatal? end |
#log_info(message) ⇒ Object
Convenience method to log info messages with the standard prefix.
74 75 76 |
# File 'lib/mongo/loggable.rb', line 74 def log_info() logger.info(()) if logger.info? end |
#log_warn(message) ⇒ Object
Convenience method to log warn messages with the standard prefix.
86 87 88 |
# File 'lib/mongo/loggable.rb', line 86 def log_warn() logger.warn(()) if logger.warn? end |