Fixed scoping in logging
Debug logging for function entry points