Edit on GitHub

uio.utility.logs

Logging functionality.

To enable debug log messages, set the environment variable UIO_EXOPLANET_GROUP_DEBUG. That will set the uio.utility.logs.debugMode flag to True.

For example, you can set it from command line like this for all the scripts:

$ export UIO_EXOPLANET_GROUP_DEBUG=1
$ python ./some.py
$ python ./another.py

or like this for just one script:

$ UIO_EXOPLANET_GROUP_DEBUG=1 python ./some.py

In a Visual Studio Code cell it can be done like this:

%set_env UIO_EXOPLANET_GROUP_DEBUG 1
 1"""
 2.. include:: ../../../../documentation/utility/logs/index.md
 3"""
 4
 5import os
 6
 7debugMode: bool = False
 8"""
 9Flag for enabling debug log. When it is set to `True`, the logging format
10is extended, and the level of details being printed out is increased.
11"""
12
13if "UIO_EXOPLANET_GROUP_DEBUG" in os.environ:
14    debugModeValue: str = os.environ["UIO_EXOPLANET_GROUP_DEBUG"].lower()
15    if (
16        debugModeValue != "0"
17        and
18        debugModeValue != "no"
19        and
20        debugModeValue != "off"
21        and
22        debugModeValue != "false"
23        and
24        debugModeValue != "disable"
25    ):
26        debugMode = True
debugMode: bool = False

Flag for enabling debug log. When it is set to True, the logging format is extended, and the level of details being printed out is increased.