added log and tests
more logging