Get a name from a user message

If you set names for your messages but forget later, you can use GetCategoryName to get the names. Remember the ID must be the same as SetCategoryName, or you can't get the correct name.

The following code is written in the function DebugMessages.

Copy
//Initialize log names to NULL.
wchar_t Log0[] = L"NULL";
wchar_t Log1[] = L"NULL";
wchar_t Log2[] = L"NULL";

//Get the log names.
GetCategoryName(0, Log0);
wprintf(L"Log 0 is: %s\n", Log0);
GetCategoryName(1, Log1);
wprintf(L"Log 1 is: %s\n", Log1);
GetCategoryName(2, Log2);
wprintf(L"Log 2 is: %s\n\n", Log2);

 

Output: