Skip to content

[Messenger] add welcome notice when running the command #29303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2019

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Nov 24, 2018

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

The current behavior of ./bin/console messenger:consume-messages is totally silent: you run it and nothing visible happens.

Here is what is displayed with this PR:
image

Combined with #30539, it gives:
image

@ro0NL
Copy link
Contributor

ro0NL commented Nov 24, 2018

class ConsoleLogger extends AbstractLogger

?

So yeah, let Worker/Receiver produce PSR logs. And provide a new ConsoleLogger or "the logger" in the "messenger" channel for that matter from the command?

@nicolas-grekas nicolas-grekas added this to the next milestone Nov 25, 2018
@dmaicher
Copy link
Contributor

do we have a standard way of decorating an Output instance with a logger to achieve that?

was also wondering about that recently. There is Symfony\Bridge\Monolog\Handler\ConsoleHandler but its specific to Monolog 😋

@Koc
Copy link
Contributor

Koc commented Dec 4, 2018

What about adding also some writeln like Start consuming messages from transport "amqp".?

@weaverryan
Copy link
Member

This bothers me too.

What about adding also some writeln like Start consuming messages from transport "amqp".?

+1 for this

which then leads to: shouldn't we inject a logger instead of an output instance?

Yea, let's inject monolog.logger.messenger and just log to it. Then, of course, people won't see the log messages in the console, by default. That can be solved by telling the user to use -v:

Consuming messages from transport "amqp".
Re-run the command with a -v option to see more details.

@weaverryan weaverryan mentioned this pull request Mar 12, 2019
36 tasks
@nicolas-grekas nicolas-grekas changed the title [Messenger] log messages that are consumed by the command [Messenger] add welcome notice when running the command Mar 12, 2019
@nicolas-grekas
Copy link
Member Author

Status: needs review

Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

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

+1

@nicolas-grekas nicolas-grekas merged commit 673b58b into symfony:master Mar 13, 2019
nicolas-grekas added a commit that referenced this pull request Mar 13, 2019
…d (nicolas-grekas)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] add welcome notice when running the command

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

The current behavior of `./bin/console messenger:consume-messages` is totally silent: you run it and nothing visible happens.

Here is what is displayed with this PR:
![image](https://user-images.githubusercontent.com/243674/54235039-af0a6c80-4510-11e9-89d8-3c1c55e946c0.png)

Combined with #30539, it gives:
![image](https://user-images.githubusercontent.com/243674/54235156-ed079080-4510-11e9-9d4d-9f27c87e16e5.png)

Commits
-------

673b58b [Messenger] add welcome notice when running the command
@nicolas-grekas nicolas-grekas deleted the messenger-output branch March 15, 2019 13:41
@nicolas-grekas nicolas-grekas removed this from the next milestone Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants