Development Specs: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(verbose level ideas)
(→‎Verbosity levels: corrections)
Line 20: Line 20:
== Verbosity levels ==
== Verbosity levels ==


Abstract concept:
;Abstract concept


{|
{|
|-
|-
|verbose || 3
|verbose || 3 || MAX_LEVEL
|-
|-
|standard || 2
|standard || 2 || STD_LEVEL
|-
|-
|brief || 1
|brief || 1
|-
|-
|silent but not mute || 0
|silent but not mute || 0 || MIN_LEVEL
|-
|-
|mute || 2>&1 > /dev/null
|mute || 2>&1 > /dev/null
Line 36: Line 36:
|}
|}


Proposal:
;Proposal
* module output (should be parsable) is not controlled by GRASS_VERBOSE [use fprintf (stdout, ...)]
 
* module output (should be "parsable") is not controlled by GRASS_VERBOSE [use fprintf (stdout, ...)]
* silent
* silent
** only warnings and fatal errors are printed
** only warnings and fatal errors are printed
* brief
* brief
** all G_percent() and selected G_message() (up to the programmer ??)
** all G_percent() and selected G_message() (especially connected to progress information, up to the programmer ??)
* standard
* standard
** all G_percent() and selected G_message()
** all G_percent() and selected G_message()
Line 47: Line 48:
** all G_percent() + G_message()
** all G_percent() + G_message()


Modification:
;Modification


* remove verbose level → standard == all G_percent () + G_messages()
* remove verbose level → standard == all G_percent () + G_messages()
* move some messages to G_debug()
* move some messages to G_debug()

Revision as of 15:55, 26 February 2007

Systematic Approach

  • Collect all possible error states from functions
  • assign error codes for macros?
  • G_option() parameters (like output->description = ("Path to resulting ASCII file");)

How should Errors/Warnings/Messages be formatted

  • strings < >
  • numbers [ ]

Macros to be defined for C library

  • MSG_RASTER_NOT_FOUND_IN_MAPSET - "Raster map <%s> not found in <%s>"
  • MSG_CANNOT_OPEN_RASTER - "Failed opening raster map <%s>"
  • MSG_CANNOT_OPEN_FILE - Cannot open file <%s>

Parameters and flags

Fix the parameters and flags. Make it a concept. See proposal in GRASS 5 documents/parameter_proposal.txt

Verbosity levels

Abstract concept
verbose 3 MAX_LEVEL
standard 2 STD_LEVEL
brief 1
silent but not mute 0 MIN_LEVEL
mute 2>&1 > /dev/null
Proposal
  • module output (should be "parsable") is not controlled by GRASS_VERBOSE [use fprintf (stdout, ...)]
  • silent
    • only warnings and fatal errors are printed
  • brief
    • all G_percent() and selected G_message() (especially connected to progress information, up to the programmer ??)
  • standard
    • all G_percent() and selected G_message()
  • verbose
    • all G_percent() + G_message()
Modification
  • remove verbose level → standard == all G_percent () + G_messages()
  • move some messages to G_debug()