Opened 11 years ago

Last modified 4 years ago

#312 new defect

wxNVIZ prints debug to terminal

Reported by: msieczka Owned by: grass-dev@…
Priority: minor Milestone: 6.4.6
Component: wxGUI Version: svn-releasebranch64
Keywords: digitizer Cc:
CPU: All Platform: All

Description

E.g. at raster load time it pollutes the terminal with:

 Loading raster map <erode.index@PERMANENT>...
Loading raster map <erode.index@PERMANENT>...
Translating colors from raster map <erode.index@PERMANENT>...
  99%

Change History (6)

comment:1 Changed 7 years ago by neteler

Keywords: digitizer added
Milestone: 6.4.06.4.3
Version: svn-develbranch6svn-releasebranch64

This is still an issue for the wxdigitizer (not debug but suer messages):

GRASS 6.4.3svn (nc_spm_08):~ > 
GRASS_INFO_PERCENT: 0
GRASS_INFO_PERCENT: 100

GRASS_INFO_PERCENT: 0
GRASS_INFO_PERCENT: 12
GRASS_INFO_PERCENT: 25
GRASS_INFO_PERCENT: 37
GRASS_INFO_PERCENT: 50
GRASS_INFO_PERCENT: 62
GRASS_INFO_PERCENT: 75
GRASS_INFO_PERCENT: 87
GRASS_INFO_PERCENT: 100

GRASS_INFO_MESSAGE(10737,1): Building topology for vector map <ciao>...
GRASS_INFO_END(10737,1)

GRASS_INFO_MESSAGE(10737,2): Registering primitives...
GRASS_INFO_END(10737,2)

GRASS_INFO_MESSAGE(10737,3): 6 primitives registered
GRASS_INFO_END(10737,3)

GRASS_INFO_MESSAGE(10737,4): 18 vertices registered
GRASS_INFO_END(10737,4)

GRASS_INFO_MESSAGE(10737,5): Building areas...
GRASS_INFO_END(10737,5)

GRASS_INFO_PERCENT: 16
GRASS_INFO_PERCENT: 33
GRASS_INFO_PERCENT: 50
GRASS_INFO_PERCENT: 66
GRASS_INFO_PERCENT: 83
GRASS_INFO_PERCENT: 100

GRASS_INFO_MESSAGE(10737,6): 3 areas built
GRASS_INFO_END(10737,6)

GRASS_INFO_MESSAGE(10737,7): 1 isles built
GRASS_INFO_END(10737,7)

GRASS_INFO_MESSAGE(10737,8): Attaching islands...
GRASS_INFO_END(10737,8)

GRASS_INFO_PERCENT: 100

GRASS_INFO_MESSAGE(10737,9): Attaching centroids...
GRASS_INFO_END(10737,9)

GRASS_INFO_PERCENT: 16
GRASS_INFO_PERCENT: 33
GRASS_INFO_PERCENT: 50
GRASS_INFO_PERCENT: 66
GRASS_INFO_PERCENT: 83
GRASS_INFO_PERCENT: 100

GRASS_INFO_MESSAGE(10737,10): Number of nodes: 4
GRASS_INFO_END(10737,10)

GRASS_INFO_MESSAGE(10737,11): Number of primitives: 6
GRASS_INFO_END(10737,11)

GRASS_INFO_MESSAGE(10737,12): Number of points: 0
GRASS_INFO_END(10737,12)

GRASS_INFO_MESSAGE(10737,13): Number of lines: 0
GRASS_INFO_END(10737,13)

GRASS_INFO_MESSAGE(10737,14): Number of boundaries: 6
GRASS_INFO_END(10737,14)

GRASS_INFO_MESSAGE(10737,15): Number of centroids: 0
GRASS_INFO_END(10737,15)

GRASS_INFO_MESSAGE(10737,16): Number of areas: 3
GRASS_INFO_END(10737,16)

GRASS_INFO_MESSAGE(10737,17): Number of isles: 1
GRASS_INFO_END(10737,17)

GRASS_INFO_MESSAGE(10737,18): Number of areas without centroid: 3
GRASS_INFO_END(10737,18)

comment:2 Changed 5 years ago by neteler

Still an issue.

Does anyone know how to intercept GRASS_INFO_MESSAGE() etc to avoid that it gets printed to the terminal?

comment:3 in reply to:  2 ; Changed 5 years ago by glynn

Replying to neteler:

Does anyone know how to intercept GRASS_INFO_MESSAGE() etc to avoid that it gets printed to the terminal?

export GRASS_MESSAGE_FORMAT=silent

Alternatively, identify the G_message() calls and change them to G_verbose_message() so that they don't get printed without --verbose.

comment:4 in reply to:  3 ; Changed 5 years ago by wenzeslaus

Replying to glynn:

Replying to neteler:

Does anyone know how to intercept GRASS_INFO_MESSAGE() etc to avoid that it gets printed to the terminal?

export GRASS_MESSAGE_FORMAT=silent

Alternatively, identify the G_message() calls and change them to G_verbose_message() so that they don't get printed without --verbose.

I don't understand the issue very well. Does this mean that we need to change all G_message() calls in the library if there is a chance that the part will be used directly by some GUI application (vdigit, nviz, iclass)?

comment:5 in reply to:  4 Changed 5 years ago by glynn

Replying to wenzeslaus:

Alternatively, identify the G_message() calls and change them to G_verbose_message() so that they don't get printed without --verbose.

I don't understand the issue very well. Does this mean that we need to change all G_message() calls in the library if there is a chance that the part will be used directly by some GUI application (vdigit, nviz, iclass)?

First, should GUI programs be different to non-GUI programs in this regard?

The issue is that library functions are generating messages, meaning that any program which uses those functions will generate messages. It's debatable whether library functions have enough context to decide which messages are appropriate.

Vlib is particularly noisy in this regard. I count 113 calls to G_message() in lib/*/*.c (excluding test suites). 59 of those (more than half) are in Vlib.

The other issue seems to be that GUI-format messages are being written to the terminal, which suggests an issue in the way that the program is started (i.e. something is executing it with GRASS_MESSAGE_FORMAT=gui but not capturing its output; the point of GRASS_MESSAGE_FORMAT=gui is to use a machine-readable format so that a GUI can process the messages).

comment:6 Changed 4 years ago by neteler

Milestone: 6.4.36.4.6
Note: See TracTickets for help on using tickets.