From b9cb2713390c0494503c6cb95d59b76d1808777f Mon Sep 17 00:00:00 2001 From: Markus Neteler Date: Thu, 2 Jun 2022 16:14:02 +0200 Subject: [PATCH] grass.script: Explain setting of debug level (#2313) * libpython core docs: explain setting of debug level --- python/grass/script/core.py | 13 ++++++++++--- .../temporal/temporal_topology_dataset_connector.py | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/python/grass/script/core.py b/python/grass/script/core.py index da8c466bebf..ca7737c4781 100644 --- a/python/grass/script/core.py +++ b/python/grass/script/core.py @@ -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. @@ -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? diff --git a/python/grass/temporal/temporal_topology_dataset_connector.py b/python/grass/temporal/temporal_topology_dataset_connector.py index 104c5ba3b90..b71a4b9a16e 100644 --- a/python/grass/temporal/temporal_topology_dataset_connector.py +++ b/python/grass/temporal/temporal_topology_dataset_connector.py @@ -3,7 +3,7 @@ Usage: -.. code-block:: python: +.. code-block:: python >>> import grass.temporal as tgis >>> tmr = tgis.TemporalTopologyDatasetConnector() @@ -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