Skip to content

Capture console.log in JavaScript code and propagate it to the console #1249

@outoftime

Description

@outoftime

If the regular JavaScript code contains a call to console.log, the message should appear in the Popcode JavaScript console. This means we will need to either replace the console object entirely in the preview environment, or overwrite the log method. For completeness, we might as well handle debug, info, warn, error as well.

We should make sure not to break any other built-in console methods (e.g. console.time()).

I think it makes sense for calls to console.log and friends to still appear in the browser’s JavaScript console—so when we override the built-in functionality, we should hold references to the original methods and call them as well.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions