please reduce the number of lines printed to stdout/stderr

Bug #610743 reported by Timo Juhani Lindfors
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
FoxtrotGPS
Triaged
Wishlist
Unassigned

Bug Description

When I start foxtrotgps (0.99.4+debian3-1 from debian unstable on amd64) its prints a staggering number of confusing messages:

$ foxtrotgps

(foxtrotgps:13746): Gtk-CRITICAL **: gtk_toolbar_set_icon_size: assertion `icon_size != GTK_ICON_SIZE_INVALID' failed

(foxtrotgps:13746): Gtk-CRITICAL **: gtk_toolbar_set_icon_size: assertion `icon_size != GTK_ICON_SIZE_INVALID' failed
REPOLIST == NULL
gconf GPSD address not set
gconf GPSD port not set
*** on_drawingarea1_configure_event():
pixmap created
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
* mouse drag +8events
map_redraw: hmm, in the last 500ms another DL started - still one thread running
close(33) in netlib_connectsock()
* mouse drag +8events
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
* mouse drag +8events
close(14) in netlib_connectsock()
close(33) in netlib_connectsock()
map_redraw: hmm, in the last 500ms another DL started - still one thread running
close(14) in netlib_connectsock()
close(31) in netlib_connectsock()
close(20) in netlib_connectsock()
map_redraw: hmm, in the last 500ms another DL started - still one thread running
close(14) in netlib_connectsock()
* mouse drag +8events
close(39) in netlib_connectsock()
close(14) in netlib_connectsock()
* mouse drag +8events
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
close(14) in netlib_connectsock()
...

These eventually fill my ̃/.xsession-errors completely. Would it be possible to get rid of at least

close(14) in netlib_connectsock()

that keeps repeating again and again and is the largest problem? I'm sure we could have some --debug or --verbose to enable it if needed?

Related branches

Revision history for this message
Joshua Judson Rosen (rozzin) wrote :

The "hmm, in the last 500ms another DL started - still one thread" messages have been removed in FoxtrotGPS 1.0.0.

It looks like the "close(%d) in netlib_connectsock()" messages are actually coming from inside libgps....

Revision history for this message
Timo Juhani Lindfors (timo-lindfors) wrote :

I looked at the issue, libgps almost supports specifying a custom logging function but it seems incomplete. I submitted an upstream bug at

https://developer.berlios.de/bugs/?func=detailbug&bug_id=17659&group_id=2116

Revision history for this message
Timo Juhani Lindfors (timo-lindfors) wrote :

This patch adds a custom logging function that has a default log level of LOG_IO. libgps defaults to LOG_SPIN so this reduces verbosity just enough to get rid of the "close(XX) ..." spam that is sent to stderr.

You probably should not apply this right away, let's wait for gpsd upstream to respond first.

Revision history for this message
Timo Juhani Lindfors (timo-lindfors) wrote :

I sent upstream a patch to add log levels to public API:

https://lists.berlios.de/pipermail/gpsd-dev/2010-October/008207.html

Revision history for this message
Joshua Judson Rosen (rozzin) wrote :
Revision history for this message
Timo Juhani Lindfors (timo-lindfors) wrote :

Great. I'll vote for keeping this bug report open until that version of gpsd actually reaches users so that we can test if there are still some other (possibly new!) lines printed to stdout/stderr.

Revision history for this message
Joshua Judson Rosen (rozzin) wrote :

Should we close this bug yet?

Or is there more (debug?) output that we need to eliminate?

Revision history for this message
Joshua Judson Rosen (rozzin) wrote :

If I do...:

        egrep '(^|\s)printf|(fprintf.*std)' src/*.c

... then it looks like there are quite a number of uses of stdout/stderr that probably should be replaced with calls to g_log()—or even be outright eliminated (do we really want to be logging all of those function-names, every time the functions are called?).

Revision history for this message
Timo Juhani Lindfors (timo-lindfors) wrote :

Yes, let's keep the bug open until foxtrotgps is in the state where it only prints error messages to stderr.

Changed in foxtrotgps:
status: New → Triaged
Revision history for this message
Nicola Manini (nicola.manini) wrote :

Hello,
         after switching from ubuntu to debian, I found out that the current foxtrotgps 1.2.1-1 is not printing the latitude and longitude of the current point (set with right click) as the previous (ubuntu) version did. I actually relied on that feature for my tool
http://materia.fisica.unimi.it/manini/scripts/map_photo.py
Please add foxtrotgps a --debug or a --verbosity option that if raised sufficiently allows one to restore that message (and others as well).

Thank you!

All the best,
                  Nick

Revision history for this message
Paul Wise (Debian) (pabs) wrote : Re: [Bug 610743] Re: please reduce the number of lines printed to stdout/stderr

Screen-scraping the output seems like a pretty hacky way to do things.

Since the "this point" feature automatically copies the co-ordinates to
the clipboard, could you either auto-grab the clipboard with xclip or
ask the user to paste the co-ordinates after FoxtrotGPS closes?

BTW, are you aware of the photo geotag feature?

https://www.foxtrotgps.org/doc/foxtrotgps.html#Geotagging-Photos

--
bye,
pabs

https://wiki.debian.org/PaulWise

Revision history for this message
Nicola Manini (nicola.manini) wrote :

OK, I'll try the clipboard hack.

And yes, I'm aware of the photo geotag feature. It's quite nice, but
1) I turn on the gps logging of my cellphone about once every three hikes, mainly out of battery-drain concerns;
2) As my cellphone is not precisely top quality nor especially new (only GPS, no glonass etc.), the gps localization is not so accurate, I can do far better "by hand" with foxtrotgps;
3) My camera's clock is running slightly too fast, so it tends to go out of sync with the cellphone (and therefore the recorded track) rather rapidly. I tend to have better things to do than to reset the camera time more often than about twice a year...

Anyway, thank you for the suggestion, I'll try that!

Ciao,
Nick

Revision history for this message
Joshua Judson Rosen (rozzin) wrote :

On 06/22/2018 01:38 AM, Nicola Manini wrote:
> OK, I'll try the clipboard hack.
>
> And yes, I'm aware of the photo geotag feature. It's quite nice, but
> 1) I turn on the gps logging of my cellphone about once every three hikes, mainly out of battery-drain concerns;
> 2) As my cellphone is not precisely top quality nor especially new (only GPS, no glonass etc.), the gps localization is not so accurate, I can do far better "by hand" with foxtrotgps;
> 3) My camera's clock is running slightly too fast, so it tends to go out of sync with the cellphone (and therefore the recorded track) rather rapidly. I tend to have better things to do than to reset the camera time more often than about twice a year...

I'm not entirely sure I understand what you mean in (1): I guess you mean that your phone is
your only GPS device, so if you don't have that turned on you actually have no GPS
and therefor can't produce GPS tracks?

I _think_ FoxtrotGPS's photo-geotagging feature actually deals with (3),
but not with the "I don't have a GPS trace" problem that you get from (1)
or the "I don't have a sufficiently accurate GPS trace" problem that you get from (2).

FoxtrotGPS _does_ have a "route planning" feature that you could sort of use
if you actually remembered where you went and when, but that seems like it would
still be a lot more awkward than what you're doing.

I don't know of any software to support a "manual geotagging without GPS" workflow;
I can think of a couple different ways of doing it (for a single image, or for a group of images)
via "click and drag", either of which would be a neat feature to include....

Alternately, there are some small standalone GPS logger devices available, the logs from which
can be converted to GPX by gpsbabel (I use a Wintec WBT-202, for example); these have good accuracy,
can continue logging for tens of hours on a single charge, and can easily be carried in a shirt
pocket or camera bag or even in a hat to give them a good view of the satellites :)

Revision history for this message
Nicola Manini (nicola.manini) wrote :

Thank you Joshua for all the nice advice!
I'm tempted to buy a little GPS logger, but am afraid I'll forget it at home most of the times. Sometimes I even forget my camera... ;-(

The most likely hardaware progress will come with a smartphone replacement that I plan to buy in a few months.

In the mean time, I implemented the hack suggested by PaulWise above:
http://materia.fisica.unimi.it/manini/scripts/map_photo.py
is now uses xsel (because xclip would not allow me to select that specific buffer) to communicate successfully with foxtrotgps.

Thanks a lot to both!

All the best,
                 Nick

Revision history for this message
Paul Wise (Debian) (pabs) wrote :

I think this is the way to get xclip to do what you want:

xclip -selection clipboard

--
bye,
pabs

https://wiki.debian.org/PaulWise

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.