I am finding that I am writing more and more packages/commands for other people these days and have started writing some nice default utility commands to use. However, there is always the concern for clashes with other people's custom commands, and so I have started writing informative output to the message log and console for users to see what is happening. Below is an example of one such (fully functional and with extra \message commands) command:
\newcommand{\MakeCounter}[1]{
\@ifundefined{c@#1} % Check to see if counter exists
{ %If not, create it and set it to 0.
\message{The counter #1 didn't exist, so I created it and set it to 0.}
\newcounter{#1}
\setcounter{#1}{0}
}
{ %If so, reset to 0.
\message{I just overwrote the counter #1, it was set to \arabic{#1} and I forced it to 0.}
\message{Hopefully it wasn't needed anymore.}
\setcounter{#1}{0}
}
}
However, for debugging purposes (both for myself and for helping others) I would like for the \message command output above to "pop out" in the message log/console in my IDE (Texstudio, if it matters) and was hoping there was a way to color or bold the text of \message. I've tried standard LaTeX color commands, which unsurprisingly didn't work. What commands can I use to modify the text output to the log/console? And if anyone has any other suggestions as to how to make these "pop" more at a visual scan, that would also be welcome (Side note: I know I could put some sort of unique string in for a find command in a text editor; this is just so I can do a quick visual scan of the end of a compile to see if any of my own messages posted and what they returned as a 'stage-one' debug).
\@latex@warning{Message}and\@latex@error{SomeMessage}{Details}would help making them "pop"? (These commands are based on the LaTeX\GenericWarningand\GenericError, but you're probably better off using the@warning) – Andreas Storvik Strauman May 16 '18 at 15:28