Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Console][WebProfiler] Profiled commands don't contain dump data #61971

Copy link
Copy link
@Steveb-p

Description

@Steveb-p
Issue body actions

Symfony version(s) affected

7.3

Description

When using --profile, debug section is always empty.

Image

Reason for this is that debug.dump_listener is not aware that data_collector.dump exists, and that DataCollector is not called. If I replace DataDumperInterface $dumper argument from debug.dump_listener with data_collector.dump instead, collected data is registered in the profiler as expected.

How to reproduce

  • Create a new Symfony project
  • Install profiler and debug dependencies (composer require --dev debug profiler)
  • Create any command with dump('foo') in execute method
  • Call created command with --profiler option

Possible Solution

Simply adding data_collector.dump as an additional dependency to debug.dump_listener seems to work, although it's possible that it should only be called if --profile was actually passed. Not sure about other side effects this might have.

Here is the result I got once I swapped dumper in debug.dump_listener with data_collector.dump (which removed the dump output from console, of course).

# vendor/symfony/debug-bundle/Resources/config/services.php
    $services
        ->set('debug.dump_listener', DumpListener::class)
            ->args([
                service('var_dumper.cloner'),
                # Replaced:
                # service('var_dumper.cli_dumper'),
                service('data_collector.dump'),
                null,
            ])
            ->tag('kernel.event_subscriber');
Image

Additional Context

No response

alongosz

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.