Use a logging framework.