Skip to content

cxx-qt-lib: Add two more QtLogging functions #1227

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

Merged
merged 1 commit into from
May 19, 2025

Conversation

redstrate
Copy link
Contributor

This adds two new global functions available in : qFormatLogMessage and qSetMessagePattern.

qFormatLogMessage is similar to qt_message_output, but actually documented. Instead of going to the default message handler though, it outputs to a QString. This is probably not useful without message handler support, but it's easy to expose.

qSetMessagePattern is very useful, as it allows CXX-Qt applications to set custom Qt message patterns for logging.

@redstrate redstrate self-assigned this Mar 14, 2025
@redstrate redstrate force-pushed the work/josh/qtlogging-format branch from 9772397 to 7c5ef0b Compare March 14, 2025 14:04
Copy link

codecov bot commented Mar 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (fb83a89) to head (a436301).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1227   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           73        73           
  Lines        12681     12681           
=========================================
  Hits         12681     12681           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@LeonMatthesKDAB LeonMatthesKDAB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some smaller issues, but more importantly we need to investigate whether set_message_pattern is safe to call!

@LeonMatthesKDAB
Copy link
Collaborator

Ping @redstrate, can you solve the remaining issues?

@redstrate redstrate force-pushed the work/josh/qtlogging-format branch 2 times, most recently from b24934b to 337c4e8 Compare May 7, 2025 12:20
@redstrate
Copy link
Contributor Author

Ping @redstrate, can you solve the remaining issues?

Done, sorry it's been a busy week - but I have time now :)

@redstrate redstrate force-pushed the work/josh/qtlogging-format branch from 337c4e8 to 0b04610 Compare May 7, 2025 12:23
@redstrate redstrate requested a review from LeonMatthesKDAB May 7, 2025 12:23
@redstrate redstrate force-pushed the work/josh/qtlogging-format branch from 0b04610 to 6c13f1e Compare May 7, 2025 12:41
This adds two new global functions available in <QtLogging>:
qFormatLogMessage and qSetMessagePattern.

qFormatLogMessage is similar to qt_message_output, but actually
documented. Instead of going to the default message handler though, it
outputs to a QString. This is probably not useful without message
handler support, but it's easy to expose.

qSetMessagePattern is very useful, as it allows CXX-Qt applications to
set custom Qt message patterns for logging.
@LeonMatthesKDAB LeonMatthesKDAB force-pushed the work/josh/qtlogging-format branch from 6c13f1e to a436301 Compare May 19, 2025 09:28
@LeonMatthesKDAB LeonMatthesKDAB enabled auto-merge (rebase) May 19, 2025 09:28
@LeonMatthesKDAB LeonMatthesKDAB disabled auto-merge May 19, 2025 11:57
@LeonMatthesKDAB LeonMatthesKDAB added this pull request to the merge queue May 19, 2025
Merged via the queue into KDAB:main with commit cdce7bd May 19, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants