All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/qt5/qt5base: add -syslog option
@ 2020-11-03 22:18 jzignego at hedcontrols.com
  2020-11-04 10:33 ` Peter Seiderer
  2020-11-04 18:12 ` [Buildroot] [PATCH v2 " jzignego at hedcontrols.com
  0 siblings, 2 replies; 5+ messages in thread
From: jzignego at hedcontrols.com @ 2020-11-03 22:18 UTC (permalink / raw)
  To: buildroot

From: Jeff Zignego <jzignego@hedcontrols.com>

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

Signed-off-by: Jeff Zignego <jzignego@hedcontrols.com>
---
 package/qt5/qt5base/qt5base.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index ed308c1fa2..d9b8ff279b 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -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
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/qt5/qt5base: add -syslog option
  2020-11-03 22:18 [Buildroot] [PATCH 1/1] package/qt5/qt5base: add -syslog option jzignego at hedcontrols.com
@ 2020-11-04 10:33 ` Peter Seiderer
  2020-11-04 18:56   ` Jeff Zignego
  2020-11-04 18:12 ` [Buildroot] [PATCH v2 " jzignego at hedcontrols.com
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Seiderer @ 2020-11-04 10:33 UTC (permalink / raw)
  To: buildroot

Hello Jeff,

On Tue,  3 Nov 2020 16:18:17 -0600, jzignego--- via buildroot <buildroot@busybox.net> wrote:

> From: Jeff Zignego <jzignego@hedcontrols.com>
>
> 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
>
> Signed-off-by: Jeff Zignego <jzignego@hedcontrols.com>
> ---
>  package/qt5/qt5base/qt5base.mk | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
> index ed308c1fa2..d9b8ff279b 100644
> --- a/package/qt5/qt5base/qt5base.mk
> +++ b/package/qt5/qt5base/qt5base.mk
> @@ -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
> +

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



>  ifeq ($(BR2_PACKAGE_IMX_GPU_VIV),y)
>  # use vivante backend
>  QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_viv

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2 1/1] package/qt5/qt5base: add -syslog option
  2020-11-03 22:18 [Buildroot] [PATCH 1/1] package/qt5/qt5base: add -syslog option jzignego at hedcontrols.com
  2020-11-04 10:33 ` Peter Seiderer
@ 2020-11-04 18:12 ` jzignego at hedcontrols.com
  2020-11-07 13:46   ` Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: jzignego at hedcontrols.com @ 2020-11-04 18:12 UTC (permalink / raw)
  To: buildroot

From: Jeff Zignego <jzignego@hedcontrols.com>

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.

Signed-off-by: Jeff Zignego <jzignego@hedcontrols.com>

---
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(+)

diff --git a/package/qt5/qt5base/Config.in b/package/qt5/qt5base/Config.in
index ce7230c728..ce7b5f0770 100644
--- a/package/qt5/qt5base/Config.in
+++ b/package/qt5/qt5base/Config.in
@@ -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
diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index ed308c1fa2..fa92625738 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -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
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/qt5/qt5base: add -syslog option
  2020-11-04 10:33 ` Peter Seiderer
@ 2020-11-04 18:56   ` Jeff Zignego
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Zignego @ 2020-11-04 18:56 UTC (permalink / raw)
  To: buildroot

On Wed, 2020-11-04 at 11:33 +0100, Peter Seiderer wrote:
> External email: CAUTION, be careful with links or attachments!
> 
> 
> Hello Jeff,
> 
> On Tue,  3 Nov 2020 16:18:17 -0600, jzignego--- via buildroot <
> buildroot at busybox.net> wrote:
> 
> > From: Jeff Zignego <jzignego@hedcontrols.com>
> > 
> > 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
> > 
> > Signed-off-by: Jeff Zignego <jzignego@hedcontrols.com>
> > ---
> >  package/qt5/qt5base/qt5base.mk | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/package/qt5/qt5base/qt5base.mk
> > b/package/qt5/qt5base/qt5base.mk
> > index ed308c1fa2..d9b8ff279b 100644
> > --- a/package/qt5/qt5base/qt5base.mk
> > +++ b/package/qt5/qt5base/qt5base.mk
> > @@ -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
> > +
> 
> 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
> 
> 
> 
> >  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. 

-- 
Thanks,
Jeff Zignego

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2 1/1] package/qt5/qt5base: add -syslog option
  2020-11-04 18:12 ` [Buildroot] [PATCH v2 " jzignego at hedcontrols.com
@ 2020-11-07 13:46   ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2020-11-07 13:46 UTC (permalink / raw)
  To: buildroot

On Wed,  4 Nov 2020 12:12:21 -0600
jzignego--- via buildroot <buildroot@busybox.net> wrote:

> From: Jeff Zignego <jzignego@hedcontrols.com>
> 
> 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.
> 
> Signed-off-by: Jeff Zignego <jzignego@hedcontrols.com>
> 
> ---
> 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(+)

Applied to next, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-07 13:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 22:18 [Buildroot] [PATCH 1/1] package/qt5/qt5base: add -syslog option jzignego at hedcontrols.com
2020-11-04 10:33 ` Peter Seiderer
2020-11-04 18:56   ` Jeff Zignego
2020-11-04 18:12 ` [Buildroot] [PATCH v2 " jzignego at hedcontrols.com
2020-11-07 13:46   ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.