Contextlog implementation

use http://pytest.org/latest/capture.html#accessing-captured-output-from-a-test-function