Conditional logging. Closes #11.