Le Sun, Apr 09, 2023 at 11:41:22AM +0200, Antoine Jacoutot a écrit :
> On Sun, Apr 09, 2023 at 10:31:28AM +0100, Stuart Henderson wrote:
> > On 2023/04/09 09:50, Landry Breuil wrote:
> > > Hi,
> > > 
> > > here's a smallish patch to silence some annoying warnings i have in my
> > > logs on my mozilla builder at each build, which is running headless and
> > > doesnt have a notification daemon running:
> > > 
> > > Apr  9 07:07:05 c64 notify-send: vfprintf %s NULL in "Using sever %s %s, 
> > > v%s - Supporting Notification Spec %s"
> > > Apr  9 07:07:05 c64 last message repeated 3 times
> > > Apr  9 07:12:16 c64 notify-send: vfprintf %s NULL in "Using sever %s %s, 
> > > v%s - Supporting Notification Spec %s"
> > > Apr  9 07:12:16 c64 last message repeated 3 times
> > 
> > These are *all* over the place in various software, it can result in a
> > huge amount of crap sent to syslog. Example from the first machine running
> > GNOME I looked at below - if I look harder there's a good chance I'll
> > find some with "last message repeated" counts in the hundreds.
> > 
> > Basically it seems that g_debug callers expect to be able to use NULL
> > srrings and it would be huge whack-a-mole to clean them up. I wonder
> > if it might be better to do something to catch these in g_debug() and
> > avoid passing the NULL to vfprintf.
> 
> Ah that would be much better indeed.

I've had a quick look and got a bit lost in the maze, but my
understanding is that via various aliases/defines, the function called
is g_logv in
https://gitlab.gnome.org/GNOME/glib/-/blob/main/glib/gmessages.c#L1291 -
so the code should iterate on args and replace the NULL ones by '(null)' ?
or in format_string() ? there seems to be many dragons and
abstractions in that code...

Landry

Reply via email to