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

Improve qgsmessagelog caller information #60265

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

benoitdm-oslandia
Copy link
Contributor

QgsMessageLog::log calls  QgsDebugMsgLevel which display caller information based on the __FILE__, __FUNCTION__ and __FILE__ macros. This produce outputs like below where the caller information are lost:

src/core/qgsmessagelog.cpp:35 : (logMessage) [2ms] 2025-01-22T19:34:33 Server[0] WMS Request parameters:
src/core/qgsmessagelog.cpp:35 : (logMessage) [0ms] 2025-01-22T19:34:33 Server[0]  - CRS : EPSG:3857

This PR makes use of __builtin_FILE(), __builtin_FUNCTION() and __builtin_LINE() buildin c++ functions to retrieve the caller information to produce something like that:

src/server/services/wms/qgswmsparameters.cpp:565 : (dump) [52ms] 2025-01-24T16:13:15 Server[0] WMS Request parameters:
src/server/services/wms/qgswmsparameters.cpp:579 : (dump) [0ms] 2025-01-24T16:13:15 Server[0]  - CRS : EPSG:3857

@benoitdm-oslandia benoitdm-oslandia self-assigned this Jan 24, 2025
@github-actions github-actions bot added this to the 3.42.0 milestone Jan 24, 2025
@benoitdm-oslandia
Copy link
Contributor Author

cc @ptitjano @lbartoletti

@nirvn
Copy link
Contributor

nirvn commented Jan 24, 2025

Nifty

@Gustry Gustry added the Server Related to QGIS server label Jan 24, 2025
@ptitjano
Copy link
Contributor

Looks good to me!

Copy link

github-actions bot commented Jan 24, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 5543111)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 5543111)

Co-authored-by: Loïc Bartoletti <lbartoletti@users.noreply.github.com>
@lbartoletti lbartoletti merged commit 7fc95bb into qgis:master Jan 27, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Server Related to QGIS server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants