astropy/astropy — pull request #93 by astrofrog (2011-11-28 10:54:39+00:00)
Title: Implemented logger

(This is not yet ready for merging)

I've implemented a basic logger, and have added some documentation to describe how to use it. I am struggling with writing tests for this, as even though py.test allows one to capture stdout and stderr, a test such as:

def test_info(capsys):
logger.info("This is an info message")
out, err = capsys.readouterr()
assert err == "INFO: This is an info message"

does not work, even though py.test says the captured output is "INFO: This is an info message". Any ideas?

There are a few lines to wrap for the ConfigurationItem descriptions, but I will do this once we are happy with the strings.