Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/bleeding-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
# to use the dev version of numpy at build time.
run: uv pip install --editable .[test] --no-build-isolation

- run: yt config set --local yt log_level 50 # Disable excessive output
- name: Run Tests
run: uv run --no-sync pytest yt -vvv --color=yes

Expand Down
17 changes: 7 additions & 10 deletions doc/source/faq/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -402,18 +402,16 @@ environment can use readline, run the following command:
How can I change yt's log level?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

yt's default log level is ``INFO``. However, you may want less voluminous logging,
especially if you are in an IPython notebook or running a long or parallel script.
On the other hand, you may want it to output a lot more, since you can't figure out
exactly what's going wrong, and you want to output some debugging information.
The default yt log level can be changed using the :ref:`configuration-file`,
either by setting it in the ``$HOME/.config/yt/yt.toml`` file:
yt's default log level is ``CRITICAL`` (50), which pratically is equivalent to "disabled".
You may want to enable logging if you are developing or debugging yt itself.
This can be done via the command line. For instance, one would enable error-level
messages as

.. code-block:: bash

$ yt config set yt log_level 10 # This sets the log level to "DEBUG"
$ yt config --local set yt log_level 40

which would produce debug (as well as info, warning, and error) messages, or at runtime:
Or, at runtime:

.. code-block:: python

Expand All @@ -425,8 +423,7 @@ This is the same as doing:

yt.set_log_level(40)

which in this case would suppress everything below error messages. For reference,
the numerical values corresponding to different log levels are:
For reference, the numerical values corresponding to different log levels are:

.. csv-table::
:header: Level, Numeric Value
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Here is an example script, where we adjust the logging at startup:

This has the same effect as setting ``log_level = 1`` in the configuration
file. Note that a log level of 1 means that all log messages are printed to
stdout. To disable logging, set the log level to 50.
stdout.


.. _config-options:
Expand Down
4 changes: 0 additions & 4 deletions tests/ci_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,4 @@ fi
# but the primary intention is to embed this script in CI jobs
uv sync --extra=test ${sync_args}

# Disable excessive output
uv run --no-sync yt config set --local yt log_level 50
cat yt.toml

set +x
4 changes: 3 additions & 1 deletion yt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"colored_logs": False,
"suppress_stream_logging": False,
"stdout_stream_logging": False,
"log_level": 20,
# 50=CRITICAL practically represents *no logging*
# because critical errors are normally reported as show-stopping exceptions
"log_level": 50,
"inline": False,
"num_threads": -1,
"store_parameter_files": False,
Expand Down
1 change: 0 additions & 1 deletion yt/data_objects/tests/test_ellipsoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
def setup_module():
from yt.config import ytcfg

ytcfg["yt", "log_level"] = 50
ytcfg["yt", "internals", "within_testing"] = True


Expand Down
Loading