Do not log object properties that are functions and try JSON.stringify before checking for undefined.