Added logging for native functions that might be throwing an exception