Module: Mongo::Loggable
Overview
Allows objects to easily log operations.
Constant Summary
-
PREFIX =
The standard MongoDB log prefix.
'MONGODB'.freeze
Instance Method Summary
-
#log_debug(message)
Convenience method to log debug messages with the standard prefix.
-
#log_error(message)
Convenience method to log error messages with the standard prefix.
-
#log_fatal(message)
Convenience method to log fatal messages with the standard prefix.
-
#log_info(message)
Convenience method to log info messages with the standard prefix.
-
#log_warn(message)
Convenience method to log warn messages with the standard prefix.
-
#logger ⇒ Logger
Get the logger instance.
- #_mongo_log_prefix private
- #format_message(message) private
Instance Method Details
#_mongo_log_prefix (private)
# File 'lib/mongo/loggable.rb', line 108
def _mongo_log_prefix (respond_to?(: ) && && [:log_prefix]) || PREFIX end
#format_message(message) (private)
# File 'lib/mongo/loggable.rb', line 104
def ( ) format("%s | %s".freeze, _mongo_log_prefix, ) end
#log_debug(message)
Convenience method to log debug messages with the standard prefix.
#log_error(message)
Convenience method to log error messages with the standard prefix.
#log_fatal(message)
Convenience method to log fatal messages with the standard prefix.
#log_info(message)
Convenience method to log info messages with the standard prefix.
#log_warn(message)
Convenience method to log warn messages with the standard prefix.
#logger ⇒ Logger
Get the logger instance.