Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MonologBridge] Allow to change level format in ConsoleFormatter #26218

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
Feb 20, 2018

Conversation

ostrolucky
Copy link
Contributor

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 want to use this format %datetime% <comment>[%level_name%]</comment> %start_tag%%message%%end_tag%, but ConsoleFormatter formats in a way message looks like this:

screenshot from 2018-02-19 01-54-21

As you see, unnecessary padding looks like anomaly here and there is currently no way to remove it without making own formatter.

This option allows me to replace default padding format with %s.

This is needed to allow to remove fixed padding of level name
@nicolas-grekas nicolas-grekas added this to the 4.1 milestone Feb 19, 2018
@fabpot
Copy link
Member

fabpot commented Feb 20, 2018

Thank you @ostrolucky.

@fabpot fabpot merged commit fbd257c into symfony:master Feb 20, 2018
fabpot added a commit that referenced this pull request Feb 20, 2018
…eFormatter (ostrolucky)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[MonologBridge] Allow to change level format in ConsoleFormatter

| 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 want to use this format `%datetime% <comment>[%level_name%]</comment> %start_tag%%message%%end_tag%`, but ConsoleFormatter formats in a way message looks like this:

![screenshot from 2018-02-19 01-54-21](https://user-images.githubusercontent.com/496233/36359102-d6c20e4c-1517-11e8-9988-8a49efc4cacb.png)

As you see, unnecessary padding looks like anomaly here and there is currently no way to remove it without making own formatter.

This option allows me to replace default padding format with `%s`.

Commits
-------

fbd257c [MonologBridge] Allow to change level format
@fabpot fabpot mentioned this pull request May 7, 2018
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.

4 participants