8000 [Console] Sync ConsoleLogger::interpolate with the one in HttpKernel by dunglas · Pull Request #24527 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] Sync ConsoleLogger::interpolate with the one in HttpKernel #24527

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
Oct 15, 2017

Conversation

dunglas
Copy link
Member
@dunglas dunglas commented Oct 12, 2017
Q A
Branch? 3.4
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

Adapted from: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Log/Logger.php#L92

Better performance and datetime support (maybe should it be merged in a newer version, but I've targeted 2.7 to prevent future merge conflicts).

@sroze
Copy link
Contributor
sroze commented Oct 12, 2017

Wouldn't it be better to share the code instead of copy/pasting it?

@dunglas
Copy link
Member Author
dunglas commented Oct 12, 2017

Where would stay this code? There is no dependency in common between console and http-kernel. And creating a new component just for this method looks overkill.

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Oct 12, 2017

@sroze these are two independent components, so sharing is not possible without creating new deps, which we don't want to.

$replace[sprintf('{%s}', $key)] = $val;
if (null === $val || is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) {
$replacements["{{$key}}"] = $val;
} elseif ($val instanceof \DateTime || $val instanceof \DateTimeInterface) {
Copy link
Member

Choose a reason for hiding this comment

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

note to mergers: first condition should be removed starting from 3.3

Copy link
Member

Choose a reason for hiding this comment

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

@dunglas can you please rebase+retarget, and take this comment into account meanwhile?

@chalasr
Copy link
Member
chalasr commented Oct 12, 2017

This seems to break the appveyor build :/ (ran twice, same breakage with no output)

@fabpot
Copy link
Member
fabpot commented Oct 12, 2017

Not a bug fix, should be merged in 3.4 instead.

@dunglas dunglas force-pushed the improve_console_logger branch from 9e6ace0 to 8fcbc55 Compare October 15, 2017 12:36
@dunglas dunglas changed the base branch from 2.7 to 3.4 October 15, 2017 12:37
@dunglas
Copy link
Member Author
dunglas commented Oct 15, 2017

Status: Needs Review

@chalasr
Copy link
Member
chalasr commented Oct 15, 2017

Thank you @dunglas.

@chalasr chalasr merged commit 8fcbc55 into symfony:3.4 Oct 15, 2017
chalasr pushed a commit that referenced this pull request Oct 15, 2017
…n HttpKernel (dunglas)

This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Sync ConsoleLogger::interpolate with the one in HttpKernel

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Adapted from: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Log/Logger.php#L92

Better performance and datetime support (maybe should it be merged in a newer version, but I've targeted 2.7 to prevent future merge conflicts).

Commits
-------

8fcbc55 [Console] Sync ConsoleLogger::interpolate with the one in HttpKernel
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.

6 participants
0