Logging code that still needs work