I would like to use NSTRACE to see its built-in messages, and create new ones, at various locations within nsterm.m . I imagine/guess that enabling NSTRACE needs to be done when configuring Emacs and it probably requires launching Emacs from the terminal and perhaps an interactive call such as M-x trace-...

Q: How can I configure Emacs to enable NSTRACE and what other steps are needed to see the messages inside the terminal window?

For example, here is what I would use if I wanted to see the glyph debugging message inside xdisp.c : I would use --enable-checking='glyphs' when configuring Emacs; then I would launch Emacs from the command line in a terminal; then I would type M-x trace-redisplay and I could see glyph debugging messages inside the terminal that are created inside xdisp.c like this: