Avoid a loop when logging
Merge pull request #5 from juddmon/avoid_infinite_loop

Avoid a loop when logging