Skip to content

Allow a way to disable log redirection through QgsMessageLog#133

Merged
suricactus merged 1 commit intomasterfrom
QF-7321-less-qgis-log-repetition
Dec 9, 2025
Merged

Allow a way to disable log redirection through QgsMessageLog#133
suricactus merged 1 commit intomasterfrom
QF-7321-less-qgis-log-repetition

Conversation

@suricactus
Copy link
Collaborator

@suricactus suricactus commented Dec 8, 2025

By introducing IS_WITHIN_QFC_WORKER we are going to instruct libqfieldsync to not redirect logs to the QgsMessageLog, therefore avoiding repetitions such as:

14:22:54.842 QGSMSGLOG INFO     Layer "list_salutation" will use attribute "fid" as a primary key.
14:22:54.842 libqfieldsync INFO     Layer "list_salutation" will use attribute "fid" as a primary key.

See opengisch/QFieldCloud#1439

@duke-nyuki
Copy link

By introducing `IS_WITHIN_QFC_WORKER` we are going to instruct
`libqfieldsync` to not redirect logs to the `QgsMessageLog`, therefore
avoiding repetitions such as:

```
14:22:54.842 QGSMSGLOG INFO     Layer "list_salutation" will use attribute "fid" as a primary key.
14:22:54.842 libqfieldsync INFO     Layer "list_salutation" will use attribute "fid" as a primary key.
```
Copy link
Member

@gounux gounux left a comment

Choose a reason for hiding this comment

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

Thanks ! Indeed : less noise, smarter logs ;)

Assuming that not having this IS_WITHIN_QFC_WORKER envvar set means it's running inside QFS, I'm wondering if it would make sense to add the sister IS_WITHIN_QFIELDSYNC envvar, in case tomorrow there would be another "component" making use of libqfieldsync ?

BTW, LGTM IMHO, maybe just too maniac here, you tell me :)

@suricactus
Copy link
Collaborator Author

suricactus commented Dec 8, 2025

How do you configure IS_WITHIN_QFIELDSYNC on a windows machine running QGIS? We do not have control over the envvars on QGIS desktops.

Actually I was asking myself whether we should rename the variable to IS_HEADLESS_QGIS or DISABLE_LOGS_TO_QGS_MESSAGE_LOG, but decided this name is flexible enough for the future.

Would be great if there is a green checkmark to ensure it's a LGTM :)

Copy link
Member

@gounux gounux left a comment

Choose a reason for hiding this comment

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

How do you configure IS_WITHIN_QFIELDSYNC on a windows machine running QGIS? We do not have control over the envvars on QGIS desktops.

I was looking at this the other day : https://qgis-deployment.github.io/qgis-deployment-toolbelt-cli/

TBH IDK if I'm aware of how far it can get, maybe it's possible to manage some envvars using this toolbelt ?

Would be great if there is a green checkmark to ensure it's a LGTM :)

Sure, here you go :)

@suricactus suricactus merged commit 86bf100 into master Dec 9, 2025
6 checks passed
@suricactus suricactus deleted the QF-7321-less-qgis-log-repetition branch December 9, 2025 02:30
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.

3 participants