Basic logging code.