sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.16k stars 212 forks source link

Use different background color for messages and warnings. #7868

Open lahvak opened 1 week ago

lahvak commented 1 week ago

In notebooks with R kernel, a cell can produce a message, for example:

message("Blah blah blah")

or a warning:

warning("Blah blah blah")

Currently, both of those show in the notebook with very visible pink background. Interestingly, an actual error message:

stop("Balh blah blah")

will show on much less visible, slightly pinkish, background.

This semester, several students contacted me, concerned that they are doing something wrong, since they are getting all those error messages from their cells. It turned out they were only getting information messages sych as those produced by message(), but because of the bright pink background, they though these were errors. This was never an issue before, but this semester several students already contacted me about that.

I was thinking it would be nice to use different colors for messages, warnings, and actual errors, reflecting the different severity of those. Perhaps green for messages, yellow for warnings, and red for errors?

williamstein commented 1 week ago

This seems out of scope for CoCalc. I think there are two output streams: stdout and stderr. CoCalc and JupyterLab are consistent in rendering stderr with a reddish background:

image

This is what the output messages look like:

"outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Blah blah blah\n",
      "\n"
     ]
    }

This seems like something to take up maybe with the developers of the R jupyter kernel?

lahvak commented 1 week ago

That makes sense. R by default sends both messages and warnings to stderr.

-- Jan Hlavacek Department of Mathematical Sciences, SVSU (989) 964-2004 - https://space.lahvak.space/


From: William Stein @.> Sent: Sunday, September 22, 2024 3:39 PM To: sagemathinc/cocalc @.> Cc: Jan Hlavacek @.>; Author @.> Subject: Re: [sagemathinc/cocalc] Use different background color for messages and warnings. (Issue #7868)

This seems out of scope for CoCalc. I think there are two output streams: stdout and stderr. CoCalc and JupyterLab are consistent in rendering stderr with a reddish background:

image.png (view on web)https://github.com/user-attachments/assets/c15946ae-c12a-4cb2-ab54-b1ec472fcd4f

This is what the output messages look like:

"outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Blah blah blah\n", "\n" ] }

This seems like something to take up maybe with the developers of the R jupyter kernel?

— Reply to this email directly, view it on GitHubhttps://github.com/sagemathinc/cocalc/issues/7868#issuecomment-2366933694, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA3J2WKO5EAB63NPLXGHVPLZX4MIRAVCNFSM6AAAAABOU2BQH6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRWHEZTGNRZGQ. You are receiving this because you authored the thread.Message ID: @.***>