Skip to contentSkip to conversation

package/qt5/qt5base: add -syslog option

PATCH Superseded jzignego at hedcontrols.com 3 participants 5 messages Nov 3, 2020 – Nov 7, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/qt5/qt5base: add -syslog option

From: Jeff Zignego <[email protected]>

When using sysvinit (or the busybox implementation) qt5 can output log messages to the traditional syslog with the -syslog compile time option. This is very similar to the -journald compile time option already being leveraged in qt5base.mk

---
 package/qt5/qt5base/qt5base.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
package/qt5/qt5base/qt5base.mk +14 -0
index ed308c1fa2..d9b8ff279b 100644
@@ -254,6 +254,20 @@ else
 QT5BASE_CONFIGURE_OPTS += -no-journald
 endif
 
+ifeq ($(BR2_PACKAGE_SYSVINIT),y)
+QT5BASE_CONIGURE_OPTS += -syslog
+QT5BASE_DEPENDENCIES += sysvinit
+else
+QT5BASE_CONFIGURE_OPTS += -no-syslog
+endif
+
+ifeq ($(BR2_PACKAGE_INIT_BUSYBOX),y)
+QT5BASE_CONIGURE_OPTS += -syslog
+QT5BASE_DEPENDENCIES += busybox
+else
+QT5BASE_CONFIGURE_OPTS += -no-syslog
+endif
+
 ifeq ($(BR2_PACKAGE_IMX_GPU_VIV),y)
 # use vivante backend
 QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_viv
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 package/qt5/qt5base: add -syslog option

Hello Jeff,

Quoted 24 lines · jzignego--- via buildroot

From: Jeff Zignego <[email protected]>

When using sysvinit (or the busybox implementation) qt5 can output log messages to the traditional syslog with the -syslog compile time option. This is very similar to the -journald compile time option already being leveraged in qt5base.mk

---
 package/qt5/qt5base/qt5base.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
package/qt5/qt5base/qt5base.mk +4 -0
index ed308c1fa2..d9b8ff279b 100644
@@ -254,6 +254,20 @@ else
 QT5BASE_CONFIGURE_OPTS += -no-journald
 endif
 
+ifeq ($(BR2_PACKAGE_SYSVINIT),y)
+QT5BASE_CONIGURE_OPTS += -syslog
+QT5BASE_DEPENDENCIES += sysvinit
+else

package/qt5/qt5base/qt5base.mk else · line 270

Quoted 10 lines
package/qt5/qt5base/qt5base.mk +10 -0
+QT5BASE_CONFIGURE_OPTS += -no-syslog
+endif
+
+ifeq ($(BR2_PACKAGE_INIT_BUSYBOX),y)
+QT5BASE_CONIGURE_OPTS += -syslog
+QT5BASE_DEPENDENCIES += busybox
+else
+QT5BASE_CONFIGURE_OPTS += -no-syslog
+endif
+

This would result in busybox overwriting the sysvinit case, e.g. with BR2_PACKAGE_SYSVINIT set and BR2_PACKAGE_INIT_BUSYBOX unset:

	QT5BASE_CONFIGURE_OPTS = ... -syslog -no-syslog ...

Not an init/syslog expert, but I believe the syslog feature is independent of the init system used (as long as a some daemon is listening on the /dev/log socket, something which even works with systemd) and the used syslog.h header file is provided by the C library already (no need for another compile time dependency)...

For the Qt syslog feature I would suggest an extra config option (as some other packages do already, see e.g. BR2_PACKAGE_COLLECTD_SYSLOG, BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG), because enabling this changes the default Qt logging from stderr to syslog (see qt5base-5.15.1/src/corelib/global/qlogging.cpp), something not every user is expecting (yes I know this is not symmetrical for the systemd buildroot handling)...

Regards,
Peter

Quoted 3 lines
package/qt5/qt5base/qt5base.mk +0 -0
 ifeq ($(BR2_PACKAGE_IMX_GPU_VIV),y)
 # use vivante backend
 QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_viv
#2 lore raw

PATCH 1/1 package/qt5/qt5base: add -syslog option

Quoted 69 lines · Peter Seiderer

External email: CAUTION, be careful with links or attachments!

Hello Jeff,

Quoted 26 lines · jzignego--- via buildroot

From: Jeff Zignego <[email protected]>

When using sysvinit (or the busybox implementation) qt5 can output log
messages to the traditional syslog with the -syslog compile time option. This is very similar to the -journald compile time option already being leveraged in qt5base.mk

---
 package/qt5/qt5base/qt5base.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
package/qt5/qt5base/qt5base.mk +4 -0
index ed308c1fa2..d9b8ff279b 100644
@@ -254,6 +254,20 @@ else
 QT5BASE_CONFIGURE_OPTS += -no-journald
 endif
 
+ifeq ($(BR2_PACKAGE_SYSVINIT),y)
+QT5BASE_CONIGURE_OPTS += -syslog
+QT5BASE_DEPENDENCIES += sysvinit
+else

package/qt5/qt5base/qt5base.mk else · line 270

Quoted 10 lines
package/qt5/qt5base/qt5base.mk +10 -0
+QT5BASE_CONFIGURE_OPTS += -no-syslog
+endif
+
+ifeq ($(BR2_PACKAGE_INIT_BUSYBOX),y)
+QT5BASE_CONIGURE_OPTS += -syslog
+QT5BASE_DEPENDENCIES += busybox
+else
+QT5BASE_CONFIGURE_OPTS += -no-syslog
+endif
+

This would result in busybox overwriting the sysvinit case, e.g. with BR2_PACKAGE_SYSVINIT set and BR2_PACKAGE_INIT_BUSYBOX unset:

        QT5BASE_CONFIGURE_OPTS = ... -syslog -no-syslog ...

Not an init/syslog expert, but I believe the syslog feature is independent
of the init system used (as long as a some daemon is listening on the /dev/log
socket, something which even works with systemd) and the used syslog.h
header file is provided by the C library already (no need for another compile time dependency)...

For the Qt syslog feature I would suggest an extra config option (as some other packages do already, see e.g. BR2_PACKAGE_COLLECTD_SYSLOG, BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG), because enabling this changes the default Qt logging from stderr to syslog (see qt5base-5.15.1/src/corelib/global/qlogging.cpp), something not every user is expecting (yes I know this is not symmetrical for the systemd buildroot handling)...

Quoted 8 lines

Regards,
Peter

Quoted 3 lines
package/qt5/qt5base/qt5base.mk +0 -0
 ifeq ($(BR2_PACKAGE_IMX_GPU_VIV),y)
 # use vivante backend
 QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_viv

Ya I don't know what I was thinking, that first patch was bad. Sent a v2.

Signature · 2 lines
Thanks,
Jeff Zignego
#3 lore raw

PATCH v2 1/1 package/qt5/qt5base: add -syslog option

In reply to jzignego at hedcontrols.com

From: Jeff Zignego <[email protected]>

QT can default to outputting the logs to syslog instead of to the console with this compile time switch. That behavior can still be overridden by setting the environment variable QT_LOGGING_TO_CONSOLE to 1.

---
Changes v1 -> v2:
- all v2 changes suggested by Peter Seiderer
- create a BR2_PACKAGE_QT5BASE_SYSLOG config option
- only control with config option and not previous method

---
 package/qt5/qt5base/Config.in  | 5 +++++
 package/qt5/qt5base/qt5base.mk | 6 ++++++
 2 files changed, 11 insertions(+)
package/qt5/qt5base/Config.in +5 -0
index ce7230c728..ce7b5f0770 100644
@@ -263,6 +263,11 @@ config BR2_PACKAGE_QT5BASE_PNG
 
 endif
 
+config BR2_PACKAGE_QT5BASE_SYSLOG
+	bool "syslog"
+	help
+	  Logs to the standard UNIX logging mechanism.
+
 config BR2_PACKAGE_QT5BASE_DBUS
 	bool "DBus module"
 	depends on BR2_TOOLCHAIN_HAS_THREADS
package/qt5/qt5base/qt5base.mk +6 -0
index ed308c1fa2..fa92625738 100644
@@ -254,6 +254,12 @@ else
 QT5BASE_CONFIGURE_OPTS += -no-journald
 endif
 
+ifeq ($(BR2_PACKAGE_QT5BASE_SYSLOG),y)
+QT5BASE_CONIGURE_OPTS += -syslog
+else
+QT5BASE_CONFIGURE_OPTS += -no-syslog
+endif
+
 ifeq ($(BR2_PACKAGE_IMX_GPU_VIV),y)
 # use vivante backend
 QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_viv
Signature · 1 line
2.25.1
#4 lore raw

PATCH v2 1/1 package/qt5/qt5base: add -syslog option

Quoted 14 lines · On Wed, 4 Nov 2020 12:12:21 -0600 jzignego--- via buildroot…

From: Jeff Zignego <[email protected]>

QT can default to outputting the logs to syslog instead of to the console with this compile time switch. That behavior can still be overridden by setting the environment variable QT_LOGGING_TO_CONSOLE to 1.

---
Changes v1 -> v2:
- all v2 changes suggested by Peter Seiderer
- create a BR2_PACKAGE_QT5BASE_SYSLOG config option
- only control with config option and not previous method

Quoted 4 lines
---
 package/qt5/qt5base/Config.in  | 5 +++++
 package/qt5/qt5base/qt5base.mk | 6 ++++++
 2 files changed, 11 insertions(+)

Applied to next, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com