Quick Start
How It Works
| Import Type | Root Logger Configuration | Default Level |
|---|---|---|
CLI (praisonai command) | ✅ Automatic via configure_cli_logging() | WARNING |
Library (from praisonai import) | ❌ No automatic configuration | N/A |
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
LOGLEVEL env var | str | WARNING | Read by configure_cli_logging(). Accepts standard Python levels. |
configure_cli_logging(level) | str | int | None | None (uses LOGLEVEL or WARNING) | Idempotent; only the first call configures the root logger. |
get_logger(name) | str | None | None (returns praisonai) | Returns a namespaced praisonai.<name> logger; never mutates root. |
Common Patterns
Quieting PraisonAI in a Larger App
Routing PraisonAI Logs to a File
One-off CLI Debugging
Migration note for users upgrading past PR #1561:Before this release, importing
praisonai silently called logging.basicConfig and defaulted LOGLEVEL to INFO. From this release onward, only the CLI configures the root logger, and the default level is WARNING. If you embed PraisonAI in your own script and want the previous behaviour, call from praisonai._logging import configure_cli_logging; configure_cli_logging("INFO") at startup.Best Practices
Use namespaced loggers in library code
Use namespaced loggers in library code
Always use
get_logger("module") instead of the root logger when writing library code.Do not call basicConfig from libraries
Do not call basicConfig from libraries
Libraries should never call
logging.basicConfig() as it mutates global state. Let applications control their logging setup.Prefer LOGLEVEL for one-shot debugging
Prefer LOGLEVEL for one-shot debugging
Use the environment variable for temporary debugging instead of changing code.
Attach handlers to praisonai not root
Attach handlers to praisonai not root
When customizing PraisonAI logging, attach handlers to the
praisonai logger tree rather than the root logger.Related
Thread Safety
Thread-safe agent state and wrapper-layer improvements
Debugging
Best practices for troubleshooting PraisonAI issues

