Skip to content

Commit

Permalink
Drop rich from CLI (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex authored Dec 31, 2024
1 parent 961c409 commit a1702d5
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 114 deletions.
9 changes: 4 additions & 5 deletions logfire/_internal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import requests
from opentelemetry import trace
from rich.console import Console

from logfire.exceptions import LogfireConfigError
from logfire.propagate import ContextCarrier, get_context
Expand Down Expand Up @@ -286,7 +285,6 @@ def parse_create_new_project(args: argparse.Namespace) -> None:
project_name = args.project_name
organization = args.org
default_organization = args.default_org
console = Console(file=sys.stderr)
project_info = LogfireCredentials.create_new_project(
session=args._session,
logfire_api_url=logfire_url,
Expand All @@ -295,7 +293,7 @@ def parse_create_new_project(args: argparse.Namespace) -> None:
project_name=project_name,
)
credentials = _write_credentials(project_info, data_dir, logfire_url)
console.print(f'Project created successfully. You will be able to view it at: {credentials.project_url}')
sys.stderr.write(f'Project created successfully. You will be able to view it at: {credentials.project_url}\n')


def parse_use_project(args: argparse.Namespace) -> None:
Expand All @@ -304,7 +302,6 @@ def parse_use_project(args: argparse.Namespace) -> None:
logfire_url = args.logfire_url
project_name = args.project_name
organization = args.org
console = Console(file=sys.stderr)

projects = LogfireCredentials.get_user_projects(session=args._session, logfire_api_url=logfire_url)
project_info = LogfireCredentials.use_existing_project(
Expand All @@ -316,7 +313,9 @@ def parse_use_project(args: argparse.Namespace) -> None:
)
if project_info:
credentials = _write_credentials(project_info, data_dir, logfire_url)
console.print(f'Project configured successfully. You will be able to view it at: {credentials.project_url}')
sys.stderr.write(
f'Project configured successfully. You will be able to view it at: {credentials.project_url}\n'
)


def parse_info(_args: argparse.Namespace) -> None:
Expand Down
Loading

0 comments on commit a1702d5

Please sign in to comment.