improved logging in general wrapper