I have a header file like this:
#ifndef __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__
#define __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__
#ifdef _DEBUG
// macros for turning a number into a string
#define STRING2(x) #x
#define STRING(x) STRING2(x)
#ifdef TRIAGE_MESG_AS_WARNING
#define TRIAGE_TODO_TAG(description) __pragma(message(__FILE__"("STRING(__LINE__)") : warning : TRIAGE TO-DO: " STRING(description) ))
#define TRIAGE_FIXTHIS_TAG(description) __pragma(message(__FILE__"("STRING(__LINE__)") : warning : TRIAGE FIXTHIS: " STRING(description) ))
#else
#define TRIAGE_TODO_TAG(description) __pragma(message(__FILE__"("STRING(__LINE__)") : message : TRIAGE TO-DO: " STRING(description) ))
#define TRIAGE_FIXTHIS_TAG(description) __pragma(message(__FILE__"("STRING(__LINE__)") : message : TRIAGE FIXTHIS: " STRING(description) ))
#endif
#else
#define TRIAGE_TODO_TAG(description)
#define TRIAGE_FIXTHIS_TAG(description)
#endif
#endif // __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__
Which outputs notes to the output pane in Visual Studio 2005. When 'TRIAGE_MESG_AS_WARNING' is defined, Visual Studio will harvest these messages and list them as warnings in the Error List. It does this because the text format matches a warning. However, I don't want them to show up as warnings all the time, I would rather they show up in the Messages pane of the Error List.
How do you format lines you put in the "Output Window" so that Visual Studio will auto-magically show them in the "Messages" tab of the "Error List" window?
The format I have setup for messages in the above code looks like a message from other output, but does not get harvested in the same way.
A co-worker suggested to me that I might need to write a 'custom automation object' to write to the Messages pane. That seems like a pain, especially since it is trivial to end-up with entries in the Error pane and Warning pane simply by proper formating. Is this a possible avenue?
We're using unmanaged C++, so we can't rely on managed (.NET) only tooling. We do not want to extend VS with hooks.
To display the Output window whenever you build a project, in the Options dialog box, on the Projects and Solutions > General page, select Show Output window when build starts.
Press F11 . Visual Studio calls the Console. WriteLine(String, Object, Object) method. The console window displays the formatted string.
First, click and hold the title bar with the mouse, and then drag the window to where you want to dock it. Visual Studio displays some docking icons. Four icons are at the edge of the IDE, one each at the left, top, right, and bottom. These icons are used for docking the window at the given edge of the IDE.
alt+f5 only shows the output window.
I believe they just forgot about adding additional category: info. At least it is not specified in output format for external tools.
Citation: "Category must be either 'error' or 'warning'. Case does not matter. Like origin, category must not be localized."
Link: http://blogs.msdn.com/msbuild/archive/2006/11/03/msbuild-visual-studio-aware-error-messages-and-message-formats.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With