Add some logging-related stuff. This is still experimental and yet hairy stuff. Don't actually use it for now in other components.