Stack trace disappears when error is converted to string. I changed the types in `log.ts` to match `console.log`/`console.error`/`console.warn`. fixes #31591