Named logging

Fix #351.