@@ -124,6 +124,9 @@ class ConsoleOptions:
124124 min_log_level : LevelName = 'info'
125125 """The minimum log level to show in the console."""
126126
127+ show_project_link : bool = True
128+ """Whether to print the URL of the Logfire project after initialization."""
129+
127130
128131@dataclass
129132class PydanticPlugin :
@@ -157,7 +160,6 @@ def configure( # noqa: D417
157160 service_name : str | None = None ,
158161 service_version : str | None = None ,
159162 console : ConsoleOptions | Literal [False ] | None = None ,
160- show_summary : bool | None = None ,
161163 config_dir : Path | str | None = None ,
162164 data_dir : Path | str | None = None ,
163165 base_url : str | None = None ,
@@ -166,7 +168,6 @@ def configure( # noqa: D417
166168 additional_span_processors : Sequence [SpanProcessor ] | None = None ,
167169 additional_metric_readers : Sequence [MetricReader ] | None = None ,
168170 pydantic_plugin : PydanticPlugin | None = None ,
169- fast_shutdown : bool = False ,
170171 scrubbing : ScrubbingOptions | Literal [False ] | None = None ,
171172 inspect_arguments : bool | None = None ,
172173 sampling : SamplingOptions | None = None ,
@@ -185,8 +186,6 @@ def configure( # noqa: D417
185186 console: Whether to control terminal output. If `None` uses the `LOGFIRE_CONSOLE_*` environment variables,
186187 otherwise defaults to `ConsoleOption(colors='auto', indent_spans=True, include_timestamps=True, verbose=False)`.
187188 If `False` disables console output. It can also be disabled by setting `LOGFIRE_CONSOLE` environment variable to `false`.
188- show_summary: When to print a summary of the Logfire setup including a link to the dashboard. If `None` uses the `LOGFIRE_SHOW_SUMMARY` environment variable, otherwise
189- defaults to `True`.
190189 config_dir: Directory that contains the `pyproject.toml` file for this project. If `None` uses the
191190 `LOGFIRE_CONFIG_DIR` environment variable, otherwise defaults to the current working directory.
192191 data_dir: Directory to store credentials, and logs. If `None` uses the `LOGFIRE_CREDENTIALS_DIR` environment variable, otherwise defaults to `'.logfire'`.
@@ -199,7 +198,6 @@ def configure( # noqa: D417
199198 which exports metrics to Logfire's API.
200199 pydantic_plugin: Configuration for the Pydantic plugin. If `None` uses the `LOGFIRE_PYDANTIC_PLUGIN_*` environment
201200 variables, otherwise defaults to `PydanticPlugin(record='off')`.
202- fast_shutdown: Whether to shut down exporters and providers quickly, mostly used for tests. Defaults to `False`.
203201 scrubbing: Options for scrubbing sensitive data. Set to `False` to disable.
204202 inspect_arguments: Whether to enable
205203 [f-string magic](https://logfire.pydantic.dev/docs/guides/onboarding_checklist/add_manual_tracing/#f-strings).
@@ -270,6 +268,14 @@ def configure( # noqa: D417
270268 'Use `sampling=logfire.SamplingOptions(head=...)` instead.' ,
271269 )
272270
271+ show_summary = deprecated_kwargs .pop ('show_summary' , None ) # type: ignore
272+ if show_summary is not None : # pragma: no cover
273+ warnings .warn (
274+ 'The `show_summary` argument is deprecated. '
275+ 'Use `console=False` or `console=logfire.ConsoleOptions(show_project_link=False)` instead.' ,
276+ DeprecationWarning ,
277+ )
278+
273279 if deprecated_kwargs :
274280 raise TypeError (f'configure() got unexpected keyword arguments: { ", " .join (deprecated_kwargs )} ' )
275281
@@ -280,15 +286,13 @@ def configure( # noqa: D417
280286 service_name = service_name ,
281287 service_version = service_version ,
282288 console = console ,
283- show_summary = show_summary ,
284289 config_dir = Path (config_dir ) if config_dir else None ,
285290 data_dir = Path (data_dir ) if data_dir else None ,
286291 id_generator = id_generator ,
287292 ns_timestamp_generator = ns_timestamp_generator ,
288293 additional_span_processors = additional_span_processors ,
289294 additional_metric_readers = additional_metric_readers ,
290295 pydantic_plugin = pydantic_plugin ,
291- fast_shutdown = fast_shutdown ,
292296 scrubbing = scrubbing ,
293297 inspect_arguments = inspect_arguments ,
294298 sampling = sampling ,
@@ -332,9 +336,6 @@ class _LogfireConfigData:
332336 console : ConsoleOptions | Literal [False ] | None
333337 """Options for controlling console output"""
334338
335- show_summary : bool
336- """Whether to show the summary when starting a new project"""
337-
338339 data_dir : Path
339340 """The directory to store Logfire data in"""
340341
@@ -350,9 +351,6 @@ class _LogfireConfigData:
350351 pydantic_plugin : PydanticPlugin
351352 """Options for the Pydantic plugin"""
352353
353- fast_shutdown : bool
354- """Whether to shut down exporters and providers quickly, mostly used for tests"""
355-
356354 scrubbing : ScrubbingOptions | Literal [False ]
357355 """Options for redacting sensitive data, or False to disable."""
358356
@@ -373,15 +371,13 @@ def _load_configuration(
373371 service_name : str | None ,
374372 service_version : str | None ,
375373 console : ConsoleOptions | Literal [False ] | None ,
376- show_summary : bool | None ,
377374 config_dir : Path | None ,
378375 data_dir : Path | None ,
379376 id_generator : IdGenerator | None ,
380377 ns_timestamp_generator : Callable [[], int ] | None ,
381378 additional_span_processors : Sequence [SpanProcessor ] | None ,
382379 additional_metric_readers : Sequence [MetricReader ] | None ,
383380 pydantic_plugin : PydanticPlugin | None ,
384- fast_shutdown : bool ,
385381 scrubbing : ScrubbingOptions | Literal [False ] | None ,
386382 inspect_arguments : bool | None ,
387383 sampling : SamplingOptions | None ,
@@ -394,7 +390,6 @@ def _load_configuration(
394390 self .token = param_manager .load_param ('token' , token )
395391 self .service_name = param_manager .load_param ('service_name' , service_name )
396392 self .service_version = param_manager .load_param ('service_version' , service_version )
397- self .show_summary = param_manager .load_param ('show_summary' , show_summary )
398393 self .data_dir = param_manager .load_param ('data_dir' , data_dir )
399394 self .inspect_arguments = param_manager .load_param ('inspect_arguments' , inspect_arguments )
400395 self .ignore_no_config = param_manager .load_param ('ignore_no_config' )
@@ -428,6 +423,7 @@ def _load_configuration(
428423 include_timestamps = param_manager .load_param ('console_include_timestamp' ),
429424 verbose = param_manager .load_param ('console_verbose' ),
430425 min_log_level = param_manager .load_param ('console_min_log_level' ),
426+ show_project_link = param_manager .load_param ('console_show_project_link' ),
431427 )
432428
433429 if isinstance (pydantic_plugin , dict ):
@@ -449,8 +445,6 @@ def _load_configuration(
449445 )
450446 self .sampling = sampling
451447
452- self .fast_shutdown = fast_shutdown
453-
454448 self .id_generator = id_generator or RandomIdGenerator ()
455449 self .ns_timestamp_generator = ns_timestamp_generator or time .time_ns
456450 self .additional_span_processors = additional_span_processors
@@ -473,15 +467,13 @@ def __init__(
473467 service_name : str | None = None ,
474468 service_version : str | None = None ,
475469 console : ConsoleOptions | Literal [False ] | None = None ,
476- show_summary : bool | None = None ,
477470 config_dir : Path | None = None ,
478471 data_dir : Path | None = None ,
479472 id_generator : IdGenerator | None = None ,
480473 ns_timestamp_generator : Callable [[], int ] | None = None ,
481474 additional_span_processors : Sequence [SpanProcessor ] | None = None ,
482475 additional_metric_readers : Sequence [MetricReader ] | None = None ,
483476 pydantic_plugin : PydanticPlugin | None = None ,
484- fast_shutdown : bool = False ,
485477 scrubbing : ScrubbingOptions | Literal [False ] | None = None ,
486478 inspect_arguments : bool | None = None ,
487479 sampling : SamplingOptions | None = None ,
@@ -501,15 +493,13 @@ def __init__(
501493 service_name = service_name ,
502494 service_version = service_version ,
503495 console = console ,
504- show_summary = show_summary ,
505496 config_dir = config_dir ,
506497 data_dir = data_dir ,
507498 id_generator = id_generator ,
508499 ns_timestamp_generator = ns_timestamp_generator ,
509500 additional_span_processors = additional_span_processors ,
510501 additional_metric_readers = additional_metric_readers ,
511502 pydantic_plugin = pydantic_plugin ,
512- fast_shutdown = fast_shutdown ,
513503 scrubbing = scrubbing ,
514504 inspect_arguments = inspect_arguments ,
515505 sampling = sampling ,
@@ -533,15 +523,13 @@ def configure(
533523 service_name : str | None ,
534524 service_version : str | None ,
535525 console : ConsoleOptions | Literal [False ] | None ,
536- show_summary : bool | None ,
537526 config_dir : Path | None ,
538527 data_dir : Path | None ,
539528 id_generator : IdGenerator | None ,
540529 ns_timestamp_generator : Callable [[], int ] | None ,
541530 additional_span_processors : Sequence [SpanProcessor ] | None ,
542531 additional_metric_readers : Sequence [MetricReader ] | None ,
543532 pydantic_plugin : PydanticPlugin | None ,
544- fast_shutdown : bool ,
545533 scrubbing : ScrubbingOptions | Literal [False ] | None ,
546534 inspect_arguments : bool | None ,
547535 sampling : SamplingOptions | None ,
@@ -555,15 +543,13 @@ def configure(
555543 service_name ,
556544 service_version ,
557545 console ,
558- show_summary ,
559546 config_dir ,
560547 data_dir ,
561548 id_generator ,
562549 ns_timestamp_generator ,
563550 additional_span_processors ,
564551 additional_metric_readers ,
565552 pydantic_plugin ,
566- fast_shutdown ,
567553 scrubbing ,
568554 inspect_arguments ,
569555 sampling ,
@@ -667,6 +653,8 @@ def add_span_processor(span_processor: SpanProcessor) -> None:
667653 metric_readers = list (self .additional_metric_readers or [])
668654
669655 if (self .send_to_logfire == 'if-token-present' and self .token is not None ) or self .send_to_logfire is True :
656+ show_project_link = self .console and self .console .show_project_link
657+
670658 if self .token is None :
671659 if (credentials := LogfireCredentials .load_creds_file (self .data_dir )) is None : # pragma: no branch
672660 credentials = LogfireCredentials .initialize_project (
@@ -676,14 +664,14 @@ def add_span_processor(span_processor: SpanProcessor) -> None:
676664 credentials .write_creds_file (self .data_dir )
677665 self .token = credentials .token
678666 self .base_url = self .base_url or credentials .logfire_api_url
679- if self . show_summary : # pragma: no branch
667+ if show_project_link : # pragma: no branch
680668 credentials .print_token_summary ()
681669 else :
682670
683671 def check_token ():
684672 assert self .token is not None
685673 creds = self ._initialize_credentials_from_token (self .token )
686- if self . show_summary and creds is not None : # pragma: no branch
674+ if show_project_link and creds is not None : # pragma: no branch
687675 creds .print_token_summary ()
688676
689677 thread = Thread (target = check_token , name = 'check_logfire_token' )
0 commit comments