Log API: handle edge cases for auto-test