Skip to content

Commit

Permalink
Merge pull request #125 from endlessm/kolibri-debug
Browse files Browse the repository at this point in the history
Initialize Kolibri debug from KOLIBRI_DEBUG environment variable
  • Loading branch information
dylanmccall authored Nov 11, 2023
2 parents 36394a8 + 0968b6b commit 3dd1749
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ component of the project's version number.

### Debugging and advanced usage

#### Kolibri debug mode

When Kolibri is run in debug mode, it uses debug logging for its modules
and enables Django's debug mode. To enable Kolibri debug mode, start
kolibri-daemon with the `KOLIBRI_DEBUG` environment variable set to `1`.

#### Web inspector

For development builds, kolibri-gnome enables WebKit developer extras. You can
Expand Down
7 changes: 7 additions & 0 deletions src/kolibri_daemon/kolibri_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from kolibri_app.config import ENDLESS_KEY_DATA_DIR
from kolibri_app.globals import APP_AUTOMATIC_PROVISION
from kolibri_app.utils import getenv_as_bool

from .content_extensions_manager import ContentExtensionsManager

Expand Down Expand Up @@ -51,6 +52,12 @@ def init_kolibri(**kwargs):
for plugin_name in OPTIONAL_PLUGINS:
_enable_kolibri_plugin(plugin_name, optional=True)

# Use the KOLIBRI_DEBUG environment variable for the Kolibri debug
# initialization value. This is basically equivalent to how "kolibri
# start" works.
if "debug" not in kwargs:
kwargs["debug"] = getenv_as_bool("KOLIBRI_DEBUG", default=False)

initialize(**kwargs)

if APP_AUTOMATIC_PROVISION:
Expand Down

0 comments on commit 3dd1749

Please sign in to comment.