From 5fde3de4a6ad5dce2be9ecfdd965c5f8944cf752 Mon Sep 17 00:00:00 2001 From: Tyler Brock Date: Wed, 7 Mar 2012 13:23:00 -0500 Subject: [PATCH] RUBY-417 only show logging warning if level is :debug --- lib/mongo/util/logging.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/mongo/util/logging.rb b/lib/mongo/util/logging.rb index eed04e3..7eacafc 100644 --- a/lib/mongo/util/logging.rb +++ b/lib/mongo/util/logging.rb @@ -4,8 +4,11 @@ module Mongo DEBUG_LEVEL = defined?(Logger) ? Logger::DEBUG : 0 def write_logging_startup_message - log(:debug, "Please note that logging negatively impacts client-side performance. " + - "You should set your logging level no lower than :info in production.") + if @logger && (@logger.level == DEBUG_LEVEL) + log(:debug, "Logging level is currently :debug which could negatively impact " + + "client-side performance. You should set your logging level no lower than " + + ":info in production.") + end end # Log a message with the given level.