fixed logging issues

made the logger function globally accessible for greater flexibility and
debugging