Skip to content

Commit

Permalink
grass.script: Explain setting of debug level (#2313)
Browse files Browse the repository at this point in the history
* libpython core docs: explain setting of debug level
  • Loading branch information
neteler committed Oct 17, 2022
1 parent e831b8f commit 934bc70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions python/grass/script/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from grass.script import core as grass
grass.parser()
(C) 2008-2021 by the GRASS Development Team
(C) 2008-2022 by the GRASS Development Team
This program is free software under the GNU General Public
License (>=v2). Read the file COPYING that comes with GRASS
for details.
Expand Down Expand Up @@ -737,10 +737,17 @@ def message(msg, flag=None):


def debug(msg, debug=1):
"""Display a debugging message using `g.message -d`
"""Display a debugging message using `g.message -d`.
The visibility of a debug message at runtime is controlled by
setting the corresponding DEBUG level with `g.gisenv set="DEBUG=X"`
(with `X` set to the debug level specified in the function call).
:param str msg: debugging message to be displayed
:param str debug: debug level (0-5)
:param str debug: debug level (0-5) with the following recommended levels:
Use 1 for messages generated once of few times,
3 for messages generated for each raster row or vector line,
5 for messages generated for each raster cell or vector point.
"""
if debug_level() >= debug:
# TODO: quite a random hack here, do we need it somewhere else too?
Expand Down
4 changes: 2 additions & 2 deletions python/grass/temporal/temporal_topology_dataset_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Usage:
.. code-block:: python:
.. code-block:: python
>>> import grass.temporal as tgis
>>> tmr = tgis.TemporalTopologyDatasetConnector()
Expand Down Expand Up @@ -43,7 +43,7 @@ class TemporalTopologyDatasetConnector(object):
- finishes
- finished
.. code-block:: python:
.. code-block:: python
# We have build the temporal topology and we know the first map
start = first
Expand Down

0 comments on commit 934bc70

Please sign in to comment.