# Enabling logging and progress bar

For interactive analyses you will often want readable logs and progress bars. seapig keeps both quiet by default so library output does not surprise downstream users or CI: the package attaches a `NullHandler` to the `"seapig"` logger, and progress bars are shown only in interactive sessions (TTY / Jupyter) unless explicitly enabled. As an user of the library, you can enable or disable both behaviours from your script or notebook.

Logging -- basics - seapig uses the standard library `logging`. Call [configure_logging](../reference/utils.configure_logging.md#seapig.utils.configure_logging) once from your top-level script to attach a handler and set the level.

``` python
from seapig.utils import configure_logging, get_logger

# enable INFO logs for seapig (also respects SEAPIG_LOG_LEVEL env var)
configure_logging(level="INFO")
```

Progress bars -- basics - Progress is shown automatically in interactive sessions. To control it programmatically (useful in scripts, notebooks, and tests) import the helpers from `seapig.utils.progress`. You can force-enable or disable progress, choose the backend (`"tqdm"` or `"rich"`), and wrap any iterable with [track](../reference/utils.track.md#seapig.utils.track).

``` python
from seapig.utils import enable, set_backend

# force-enable progress and select a backend
enable()
set_backend("tqdm")  # or "rich"
```

You can suppress progress output entirely:

``` python
from seapig.utils import disable

# disable progress bars globally for the current process
disable()
```

Environment variables - SEAPIG_LOG_LEVEL controls default logging level when calling [configure_logging](../reference/utils.configure_logging.md#seapig.utils.configure_logging). - SEAPIG_PROGRESS and SEAPIG_PROGRESS_BACKEND control progress behaviour when not overridden programmatically.
