Skip to content

Support declaring multiple logging categories per header file

Arjen Hiemstra requested to merge work/ahiemstra/loggingcategory_multiple into master

Right now, if you specify the same header file for categories, the last call takes effect, which effectively means that all categories need to be declared in their own header file. I personally consider this rather cumbersome as it prevents the creation of a single "logging.h" file that contains all the logging categories. While it is possible to achieve the same result by manually creating the file, this bypasses all the advantages of having a CMake function for this.

This changes the EcmQtDeclareLoggingCategory function to store the logging declarations and definitions in a directory-scoped property, which is then used when generating the header and source files. This results in the header file containing all declared logging categories rather than the last.

Merge request reports