Skip to content
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

improvement: colorize traceback #1198

Merged
merged 4 commits into from
Apr 23, 2024
Merged

improvement: colorize traceback #1198

merged 4 commits into from
Apr 23, 2024

Conversation

mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Apr 23, 2024

Colorize traceback with pygments

  1. im pretty sure this is not the write place to do this. there are other stderrs that are not tracebacks
  2. i took a first stab at colors, but don't have the best eye for designing this
Screenshot 2024-04-22 at 11 40 10 PM Screenshot 2024-04-22 at 11 38 27 PM

Copy link

vercel bot commented Apr 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 23, 2024 5:29pm
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 23, 2024 5:29pm

@@ -255,7 +256,7 @@ def write(self, data: str) -> int:
ConsoleMsg(
stream=CellChannel.STDERR,
cell_id=self._stream.cell_id,
data=data,
data=highlight_trace_back(data),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is not the right place, but im not quite sure where is the right place

traceback -> tracebacks to not shadow builtin traceback module
if running_in_notebook():
sys.stderr.write(_highlight_traceback(traceback))
else:
sys.stderr.write(traceback)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think we could highlight with TerminalFormatter too

@akshayka akshayka merged commit 2cbd76d into main Apr 23, 2024
29 checks passed
@akshayka akshayka deleted the ms/traceback branch April 23, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants