Skip to content

Conversation

@nicolas-grekas
Copy link
Member

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

I propose to change the default for the server:run command and show php -S logs by default.
I really miss them otherwise. The -vvv mode is not suited here, because it adds a useless ERR red prefix.
I do this through a tty when available, so that the output remains colored.

Ping @javiereguiluz @weaverryan since this is mostly a DX issue.

@nicolas-grekas nicolas-grekas added the DX DX = Developer eXperience (anything that improves the experience of using Symfony) label Jun 24, 2016
$process->setTty(true);
}
$process->run();
} catch (RuntimeException $e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't runtime exceptions happen for other reasons than unsupported tty mode during $process->run();, causing weird cases of running the process twice ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's be safe, fixed

$process->disableOutput();
try {
if (OutputInterface::VERBOSITY_NORMAL > $output->getVerbosity()) {
$process->disableOutput();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to have this inside the try/catch ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no but we need to have this if/else logic so code is easier this way

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the try/cache can be inside the else (and defining $callback = null; before the if)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@fabpot
Copy link
Member

fabpot commented Jun 30, 2016

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 7cc6161 into symfony:master Jun 30, 2016
fabpot added a commit that referenced this pull request Jun 30, 2016
…olas-grekas)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[FrameworkBundle] Show server:run logs by default

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

I propose to change the default for the `server:run` command and show `php -S` logs by default.
I really miss them otherwise. The `-vvv` mode is not suited here, because it adds a useless ` ERR ` red prefix.
I do this through a tty when available, so that the output remains colored.

Ping @javiereguiluz @weaverryan since this is mostly a DX issue.

Commits
-------

7cc6161 [FrameworkBundle] Show server:run logs by default
@nicolas-grekas nicolas-grekas deleted the server-log branch June 30, 2016 15:02
@fabpot fabpot mentioned this pull request Oct 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DX DX = Developer eXperience (anything that improves the experience of using Symfony) Feature FrameworkBundle Status: Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants