Skip to content

Forbid console.log and console.info #835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mfisher87
Copy link
Member

@mfisher87 mfisher87 commented Jul 25, 2025

Description

Console calls, IMO, should be for debugging only. They're useful for users facing bugs to share information about any unexpected events. Instead of using console.log as a catch-all, I'd like to think more carefully about the purpose of each message, and either omit or log it as an error, warning, or debug message.

What do you all think?

If I've removed any calls that you all feel are important, let's change them to console.debug calls?

Checklist

  • PR has a descriptive title and content.
  • PR description contains references to any issues the PR resolves, e.g. Resolves #XXX.
  • PR has one of the labels: documentation, bug, enhancement, feature, maintenance
  • Checks are passing.
    Failing lint checks can be resolved with:
    • pre-commit run --all-files
    • jlpm run lint

📚 Documentation preview: https://jupytergis--835.org.readthedocs.build/en/835/
💡 JupyterLite preview: https://jupytergis--835.org.readthedocs.build/en/835/lite

Console calls, IMO, should be for debugging only. They're useful
for users facing bugs to share information about any unexpected events.
Instead of using `console.log` as a catch-all, I'd like to think more
carefully about the purpose of each message, and either omit or
log it as an error, warning, or debug message.
Remove log and info calls or convert them to other calls. Clean up some
messages.
Copy link
Contributor

Binder 👈 Launch a Binder on branch mfisher87/jupytergis/forbid-console-log

@mfisher87 mfisher87 changed the title Forbid console.log and console.info Forbid console.log and console.info Jul 25, 2025
@@ -302,8 +302,6 @@ const activate = async (
});
}
}

console.log('@jupytergis/jupytergis-qgis:qgisplugin is activated!');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep these as console.debug? I figured it wasn't important to print this information, but I could be missing the point :)

@mfisher87 mfisher87 force-pushed the forbid-console-log branch from 1b70c8e to af6807f Compare July 25, 2025 18:18
Copy link
Contributor

Integration tests report: appsharing.space

@mfisher87 mfisher87 enabled auto-merge (squash) July 29, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant