ceph/ceph — pull request #651 by dachary (2013-09-27 09:18:31+00:00)
Title: pybind: using logging instead of sys.stderr

The standard logging module makes it easier to capture errors in a
meaningfull way and reduces the nosetest generated goop. For instance:

PASS: test/encoding/check-generated.sh
..............F....................................................
======================================================================
FAIL: test_ceph_argparse.TestOSD.test_blackist
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/loic/software/ceph/ceph/src/test/pybind/test_ceph_argparse.py", line 837, in test_blackist
'1.2.3.4/nonce'])
File "/home/loic/software/ceph/ceph/src/test/pybind/test_ceph_argparse.py", line 46, in assert_valid_command
assert_not_in(result, [None, {}])
AssertionError: {} unexpectedly found in [None, {}]
-------------------- >> begin captured logging << --------------------
root: ERROR: Invalid command: 1.2.3.4/nonce: invalid entity, nonce nonce not integer > 0
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 128 tests in 19.425s

Although the logging format distinguishes between warning, errors etc
with standardized prefixes, the format is set to just the message so
that it does not interfere with the current way of constructing error
messages printed on stderr.

Signed-off-by: Loic Dachary