Message Boards Message Boards

0
|
1813 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Odd Warnings and Messages Behavior to Consol

Posted 1 year ago

I'm using Mathematica 13.2.

Warnings and Messages are going to the Messages window (Console?) and not the the actual notebook. This used to be changeable under Settings, but now has to be done under the Options Inspector.

If I go to the Options Inspector under Global Options | Message Options, KernelMessageAction is set to "PrintToNotebook", but they are going to the Console. In addition, these settings are all grayed-out and I can't change them. enter image description here

How do I get my warnings and messages to display in the Notebook and not in this separate window? I makes it difficult to generate Paclet Documentation that demonstrates warning and/or error conditions.

TIA, Jeff

POSTED BY: Jeffery Henning
2 Replies

Looks like the act of pressing the Preview button on paclet documentation page authoring is setting this to Console (makes sense as this operation needs a place to issue messages), but is not setting it back to Notebook once the Preview is created.

POSTED BY: Jeffery Henning

I've figured out how to change these parameter programmatically using either SetOptions or CurrentValue built-in functions. I have now set "ConsoleMessageAction"->"PrintToNotebook" under $FrontEnd.

Still, all messages go to the Console. A simple 1/0 evaluation shows this.

In[12]:= 1/0

Out[12]= ComplexInfinity

Then I checked the current settings value for "KernelMessageAction" under $FronEndSession.

In[15]:= CurrentValue[$FrontEndSession, {MessageOptions, "KernelMessageAction"}]

Out[15]= "PrintToConsole"

Wait. What? How is this getting set? Let's change it.

In[16]:= 
CurrentValue[$FrontEndSession, {MessageOptions, "KernelMessageAction"}] = "PrintToNotebook"

Out[16]= "PrintToNotebook"

Now our divide by zero test prints the error message to the Notebook.

In[17]:= 1/0

During evaluation of In[17]:= Power::infy: Infinite expression 1/0 encountered.

Out[17]= ComplexInfinity

So, how is this getting set in $FrontEndSession? While this fixes my problem, I'm not sure how it got set this way. If I shutdown Mathematica and start it back up, it seems that the change is permanent.

Solved for now.

POSTED BY: Jeffery Henning
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract