Skip to content

Serialize Symfony Console inputs by default #991

@sylfabre

Description

@sylfabre

Problem Statement

Similar to getsentry/sentry-php#1121, please add a default class serializer so objects implementing Symfony\Component\Console\Input\InputInterface are more detailed in the listed parameters of a method in a trace

Solution Brainstorm

I can submit a PR with a serializer like this, but I don't know how to register it by default.

class ConsoleInputSerializer
{
    public function __invoke(InputInterface $input): array
    {
        return [
            'arguments' => $input->getArguments(),
            'options' => $input->getOptions(),
        ];
    }
}

A possible way forward is to call the Sentry\Options::setClassSerializers() to add more serializers, but I don't know how to do that from the bundle.

Or just add this serializer to this repo, suggest a default configuration and let user decide if they want it or not.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions