$MessageList
is a global variable that gives a list of the names of messages generated during the evaluation of the current input line.
Details

- Whenever a message is output, its name, wrapped with HoldForm, is appended to $MessageList.
- With the standard Wolfram System main loop, $MessageList is reset to {} when the processing of a particular input line is complete.
- You can reset $MessageList during a computation.
Examples
Basic Examples (2)
Get a list of messages produced in a computation:


Printing can be suppressed by using $MessageList inside of Quiet:
Wolfram Research (1991), $MessageList, Wolfram Language function, https://reference.wolfram.com/language/ref/$MessageList.html.
Text
Wolfram Research (1991), $MessageList, Wolfram Language function, https://reference.wolfram.com/language/ref/$MessageList.html.
CMS
Wolfram Language. 1991. "$MessageList." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$MessageList.html.
APA
Wolfram Language. (1991). $MessageList. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$MessageList.html