Hi,
If you are using MSBuild, the output verbosity is controlled by Visual Studio itself and can be configured via Tools->Options->Projects and Solutions->Build and Run.
You can also find the preprocessor macros in the .rsp files inside your build directory (search for -D<macro> strings).
Normally, something like this would work:
#ifdef STM32L431CC
Report.DeviceType = MyIDForSTM32L431CC;
#elif defined (...)
Report.DeviceType = MyIDForSomethingElse;
#else
#error Unknown device. Add a check for it above.
#endif