Skip to content
Merged
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
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ Documentation = "https://bub.build"
[project.scripts]
bub = "bub.__main__:app"

[project.optional-dependencies]
logfire = [
"logfire>=4.31.0",
]

[dependency-groups]
dev = [
"pytest>=7.2.0",
Expand Down
14 changes: 14 additions & 0 deletions src/bub/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@
from bub.framework import BubFramework


def _instrument_bub() -> None:
try:
import logfire

logfire.configure()
except ImportError:
pass
else:
from loguru import logger

logger.configure(handlers=[logfire.loguru_handler()])


def create_cli_app() -> typer.Typer:
_instrument_bub()
framework = BubFramework()
framework.load_hooks()
app = framework.create_cli_app()
Expand Down
Loading
Loading