Fix for logging function to handle non-string data