Repository: pika/pika

Issue:
'Normal Shutdown' spam on INFO logging level
Hi.
My application operates with a lot of channels on a single connection, and i see lots of `Channel.close(0, Normal Shutdown)` messages like this
```
[15-05 14:13:29] pika.channel:MainThread:INFO - Channel.close(0, Normal Shutdown)
[15-05 14:13:29] pika.channel:MainThread:INFO - Channel.close(0, Normal Shutdown)
[15-05 14:13:33] pika.channel:MainThread:INFO - Channel.close(0, Normal Shutdown)
[15-05 14:13:33] pika.channel:MainThread:INFO - Channel.close(0, Normal Shutdown)
[15-05 14:13:33] pika.channel:MainThread:INFO - Channel.close(0, Normal Shutdown)
[15-05 14:13:33] pika.channel:MainThread:INFO - Channel.close(0, Normal Shutdown)
[15-05 14:13:33] pika.channel:MainThread:INFO - Channel.close(0, Normal Shutdown)
[15-05 14:13:33] pika.channel:MainThread:INFO - Channel.close(0, Normal Shutdown)
and so on
```
Is it really needed on INFO and not on DEBUG level?  

Discussion:

Patch:
diff --git a/pika/adapters/blocking_connection.py b/pika/adapters/blocking_connection.py
index b2b3752..349d1b4 100644
--- a/pika/adapters/blocking_connection.py
+++ b/pika/adapters/blocking_connection.py
@@ -1395,14 +1395,14 @@ class BlockingChannel(object):
                 evt.dispatch()
 
 
-    def close(self, reply_code=0, reply_text="Normal Shutdown"):
+    def close(self, reply_code=0, reply_text="Normal shutdown"):
         """Will invoke a clean shutdown of the channel with the AMQP Broker.
 
         :param int reply_code: The reply code to close the channel with
         :param str reply_text: The reply text to close the channel with
 
         """
-        LOGGER.info('Channel.close(%s, %s)', reply_code, reply_text)
+        LOGGER.debug('Channel.close(%s, %s)', reply_code, reply_text)
 
         # Cancel remaining consumers
         self._cancel_all_consumers()
diff --git a/pika/channel.py b/pika/channel.py
index 0e97293..14e2221 100644
--- a/pika/channel.py
+++ b/pika/channel.py
@@ -494,7 +494,7 @@ class Channel(object):
         return self._rpc(spec.Basic.Recover(requeue), callback,
                          [spec.Basic.RecoverOk])
 
-    def close(self, reply_code=0, reply_text="Normal Shutdown"):
+    def close(self, reply_code=0, reply_text="Normal shutdown"):
         """Invoke a graceful shutdown of the channel with the AMQP Broker.
 
         If channel is OPENING, transition to CLOSING and suppress the incoming


Test patch:
diff --git a/tests/unit/blocking_channel_tests.py b/tests/unit/blocking_channel_tests.py
index de72672..6097b57 100644
--- a/tests/unit/blocking_channel_tests.py
+++ b/tests/unit/blocking_channel_tests.py
@@ -71,7 +71,7 @@ class BlockingChannelTests(unittest.TestCase):
     def test_context_manager(self):
         with self.obj as channel:
             self.assertFalse(channel._impl.close.called)
-        channel._impl.close.assert_called_once_with(reply_code=0, reply_text='Normal Shutdown')
+        channel._impl.close.assert_called_once_with(reply_code=0, reply_text='Normal shutdown')
 
     def test_context_manager_does_not_suppress_exception(self):
         class TestException(Exception):
@@ -81,10 +81,10 @@ class BlockingChannelTests(unittest.TestCase):
             with self.obj as channel:
                 self.assertFalse(channel._impl.close.called)
                 raise TestException()
-        channel._impl.close.assert_called_once_with(reply_code=0, reply_text='Normal Shutdown')
+        channel._impl.close.assert_called_once_with(reply_code=0, reply_text='Normal shutdown')
 
     def test_context_manager_exit_with_closed_channel(self):
       with self.obj as channel:
           self.assertFalse(channel._impl.close.called)
           channel.close()
-      channel._impl.close.assert_called_with(reply_code=0, reply_text='Normal Shutdown')
+      channel._impl.close.assert_called_with(reply_code=0, reply_text='Normal shutdown')