====================== Controlling Log Output ======================= The ``AletheiaEmu`` library uses Python's built-in ``logging`` module to output useful information about its operations, such as which version of a key dependency (like CAMB) is being used, or what internal values are being computed. By default, these messages are silent. If you need to debug an issue or want to see more details about what the emulator is doing, you can easily enable these log messages in your own script. The ``AletheiaCosmo`` library uses Python's built-in ``logging`` module to output useful information about its operations, such as which version of a key dependency (like CAMB) is being used, or what internal values are being computed. This allows the user to control the level of verbosity. By default, Python's logging level is set to ``WARNING``. This means you will see any messages related to warnings, errors, or critical failures. .. note:: You may see a ``WARNING`` message printed to your console when running the emulator at high *k*, such as: ``WARNING:aletheiacosmo.AletheiaEmu:Resolution correction is > 3% (max: 1.015x at k=2.00 1/Mpc).`` This is the correct, expected behavior. It is designed to alert you that you are using the emulator in a regime where the resolution correction is non-negligible. If you find these warnings "noisy" for your production run and you understand the implications, you can easily silence them by setting the logging level to ``ERROR``. How to Control Logging Levels ----------------------------- To control the messages you see, configure the ``logging`` module at the beginning of your script, *before* you import ``aletheiacosmo``. **Example 1: Silencing Warnings (Recommended for production)** To see *only* critical errors and silence all warnings: .. code-block:: python import logging import numpy as np from aletheiacosmo import AletheiaEmu # Set the logging level to ERROR to hide warnings logging.basicConfig(level=logging.ERROR) # Now, the AletheiaEmu will be silent unless a true error occurs emu = AletheiaEmu() # ... **Example 2: Showing Informational Messages** To see the high-level "story" of the calculation (what files are loading, what steps are running, etc.), set the level to ``INFO``: .. code-block:: python import logging logging.basicConfig(level=logging.INFO) When configured to the ``INFO`` level as shown above, you will see a high-level "story" of the calculation in your console: .. code-block:: text 2025-10-27 10:30:01,123 - aletheia.cosmology - INFO - Cosmology: Using CAMB 1.5.5 ... 2025-10-27 10:30:01,456 - aletheia.Aletheia - INFO - AletheiaEmu instance created. Loading models... 2025-10-27 10:30:01,789 - aletheia.Aletheia - INFO - Emulator models and data loaded successfully. 2025-10-27 10:30:02,123 - aletheia.Aletheia - INFO - Received request for P_nl at z=1.00 2025-10-27 10:30:02,124 - aletheia.Aletheia - INFO - Initializing cosmology engine for target cosmology. 2025-10-27 10:30:02,125 - aletheia.cosmology - INFO - Cosmology object created. Initializing CAMB. 2025-10-27 10:30:02,126 - aletheia.cosmology - INFO - Initializing GrowthCalculator. 2025-10-27 10:30:02,127 - aletheia.growth - INFO - GrowthCalculator initialized. ... (and so on) ... **Example 3: Enabling Full Debug Output** For deep debugging, you can see *all* messages, including detailed internal values like the computed ``sigma12`` or ``xtilde``: .. code-block:: python import logging logging.basicConfig(level=logging.DEBUG)