RUBY-345 update logging startup message
This commit is contained in:
parent
fbadbe9977
commit
6345820eae
|
@ -608,8 +608,7 @@ module Mongo
|
|||
@logger = opts[:logger] || nil
|
||||
|
||||
if @logger
|
||||
@logger.debug("MongoDB logging. Please note that logging negatively impacts performance " +
|
||||
"and should be disabled for high-performance production apps.")
|
||||
write_logging_startup_message
|
||||
end
|
||||
|
||||
should_connect = opts.fetch(:connect, true)
|
||||
|
|
|
@ -543,8 +543,7 @@ module Mongo
|
|||
@cleanup_lock = Mutex.new
|
||||
|
||||
if @logger
|
||||
@logger.debug("MongoDB logging. Please note that logging negatively impacts performance " +
|
||||
"and should be disabled for high-performance production apps.")
|
||||
write_logging_startup_message
|
||||
end
|
||||
|
||||
should_connect = opts.fetch(:connect, true)
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
module Mongo
|
||||
module Logging
|
||||
|
||||
def write_logging_startup_message
|
||||
log(:warn, "Please note that logging negatively impacts client-side performance. " +
|
||||
"You should set your logging level no lower than :info in production.")
|
||||
end
|
||||
|
||||
# Log a message with the given level.
|
||||
def log(level, msg)
|
||||
return unless @logger
|
||||
|
|
|
@ -5,7 +5,7 @@ class CollectionTest < Test::Unit::TestCase
|
|||
context "Basic operations: " do
|
||||
setup do
|
||||
@logger = mock()
|
||||
@logger.expects(:debug)
|
||||
@logger.expects(:warn)
|
||||
end
|
||||
|
||||
should "send update message" do
|
||||
|
|
Loading…
Reference in New Issue