Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tighten up logging categories stuff #672

Merged
merged 6 commits into from
Jun 29, 2023
Merged

Tighten up logging categories stuff #672

merged 6 commits into from
Jun 29, 2023

Conversation

KitsuneRal
Copy link
Member

@KitsuneRal KitsuneRal commented Jun 27, 2023

The biggest (by diff) is, effectively, renaming logging.h to logging_categories_p.h and changing it in all the files that include it. Though not strictly necessary, I also moved one inclusion from a header file (basejob.h - the only one remaining) to make sure the library keeps logging categories to itself. Taking the logging categories to Quotient namespace is to avoid linked name clashes with clients (it all started with me adding Q_LOGGING_CATEGORY(MAIN, "quaternion.main") and failing the build with it).

Also, the logging categories are defined as inline now, obviating the need of logging.cpp to define them.

There were a small number of log lines that didn't have a category at all - this is fixed now.

@KitsuneRal KitsuneRal added the enhancement A feature or change request for the library label Jun 27, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jun 27, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

41.2% 41.2% Coverage
0.0% 0.0% Duplication

To avoid clashes with similarly named categories in client code.
It should have been updated together with Quaternion's .clang-format
in the past but only the Quaternion's one ended up in Git back then.

[skip ci]
The header logging.h mixed client-facing and library-internal things.
This commit puts library-internal things (which happened to be
definitions of logging categories and nothing else) into
logging_categories_p.h and client-facing things landed in util.h as
there not many of them (a couple of debug manipulators and operator<<
overloads).
@KitsuneRal KitsuneRal marked this pull request as ready for review June 28, 2023 16:47
@KitsuneRal KitsuneRal merged commit 35a755d into dev Jun 29, 2023
@KitsuneRal KitsuneRal deleted the kitsune/logging-tweaks branch June 29, 2023 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or change request for the library
Projects
Status: 0.8 - Done
Development

Successfully merging this pull request may close these issues.

1 participant