tweaking implementation of log conditional elements, based on feedback from @igalic. First effort at including rspec test.