The `gentoo-pipewire-launcher` script currently doesn't have logging support. The attached patch addresses this. Works For Me, but testing and feedback would be appreciated. Reproducible: Always
Created attachment 863322 [details, diff] Patch to add logging support to gentoo-pipewire-launcher.
Oh also, happy to create a man page for g-p-l if required. If so, i'd prefer to write it in mdoc(7) (because that provides semantic markup to an extent that man(7) doesn't), but can use man(7) if that's Gentoo policy.
I think you need to put quotes around the variables when they are used in commands. For example: > @GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire 1>>"${PIPEWIRE_LOG}" 2>&1 &
Created attachment 863362 [details, diff] Patch to add logging support to gentoo-pipewire-launcher.
(In reply to Mike Gilbert from comment #3) > I think you need to put quotes around the variables when they are used in > commands. For example: > > > @GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire 1>>"${PIPEWIRE_LOG}" 2>&1 & Ah yeah, good catch, thanks - patch updated. Also, i wasn't sure whether to allow the *_LOG variables to be specified in the environment, i.e. to have the 'else' branch as: : ${PIPEWIRE_LOG:='/dev/null'} : ${PIPEWIRE_PULSE_LOG:='/dev/null'} : ${WIREPLUMBER_LOG:='/dev/null'}
I like the idea, but I think we should namespace the variables (prefix with either GENTOO_ or GENTOO_PW_LAUNCHER_, or even the long GENTOO_PIPEWIRE_LAUNCHER_). This makes it clear it's something we've invented so nobody will bother upstream over it. It also makes it easier to search for. Also, date --iso-8601=seconds isn't POSIX?
(In reply to Sam James from comment #6) > I like the idea, but I think we should namespace the variables (prefix with > either GENTOO_ or GENTOO_PW_LAUNCHER_, or even the long > GENTOO_PIPEWIRE_LAUNCHER_). > > This makes it clear it's something we've invented so nobody will bother > upstream over it. It also makes it easier to search for. Ah, yeah, good point. > Also, date --iso-8601=seconds isn't POSIX? No indeed. i was assuming that it was okay to use this on the basis that @system includes GNU coreutils, such that this `date` implementation will be available. But if policy is for scripts to be POSIX, i'm happy to work with that, and can update the patch accordingly. :-)
Show me how ugly it is in a POSIX variant and we'll see? ;)
(In reply to Sam James from comment #8) > Show me how ugly it is in a POSIX variant and we'll see? ;) :-) date +%Y-%m-%dT%H:%M:%S%Z although `%Z` produces a timezone name, rather than an offset, e.g. `AEST`; as far as i can tell, there's no specifier for the latter: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/date.html
Works for me if it works for you. I don't mind the output change.
(In reply to Sam James from comment #10) > Works for me if it works for you. I don't mind the output change. Okay, great. As for prefixing the variables, i tend to lean towards: GENTOO_PIPEWIRE_LOG GENTOO_PIPEWIRE_PULSE_LOG GENTOO_WIREPLUMBER_LOG rather than e.g.: GENTOO_PW_LAUNCHER_PIPEWIRE_LOG GENTOO_PW_LAUNCHER_PIPEWIRE_PULSE_LOG GENTOO_PW_LAUNCHER_WIREPLUMBER_LOG which feel too unwieldy to me. And abbreviating gentoo-pipewire-launcher to 'GPL' would be a rather misleading prefix. :-)
OK with me if you're ok to update the wiki accordingly.
Created attachment 863468 [details, diff] Patch to add logging support to gentoo-pipewire-launcher.
(In reply to Sam James from comment #12) > OK with me if you're ok to update the wiki accordingly. Sure, can do. Patch updated.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18e66b5f484739b45fcc12f8fa89c4d45acd8b80 commit 18e66b5f484739b45fcc12f8fa89c4d45acd8b80 Author: Alexis <flexibeast@gmail.com> AuthorDate: 2023-06-05 09:43:26 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-06-07 09:49:48 +0000 media-video/pipewire: Add logging support to gentoo-pipewire-launcher Closes: https://bugs.gentoo.org/907891 Signed-off-by: Alexis <flexibeast@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> .../pipewire/files/gentoo-pipewire-launcher.in-r2 | 77 ++++++++++++++++++++++ media-video/pipewire/pipewire-0.3.71-r2.ebuild | 2 +- media-video/pipewire/pipewire-9999.ebuild | 2 +- 3 files changed, 79 insertions(+), 2 deletions(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c268e89f934af7a752e756e3207eae31f311cb19 commit c268e89f934af7a752e756e3207eae31f311cb19 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-06-07 09:47:59 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-06-07 09:47:59 +0000 media-video/pipewire: add 0.3.71-r2 (unchanged from 0.3.71-r1 for now) Doing it this way to get a clean git history for the 2 changes from flexibeast. Bug: https://bugs.gentoo.org/907966 Bug: https://bugs.gentoo.org/907891 Signed-off-by: Sam James <sam@gentoo.org> media-video/pipewire/pipewire-0.3.71-r2.ebuild | 461 +++++++++++++++++++++++++ 1 file changed, 461 insertions(+)
Thanks as ever!