Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[MonologBridge] Fix debug processor datetime type#34601
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Could you please add a test case? Not that this should be for branch 3.4, where the bug is apparently.
Uh oh!
There was an error while loading.Please reload this page.
mRoca commentedNov 25, 2019
Target branch is now 3.4, and tests have been added. The bug is still present in theDebugHandler, which have been deprecated in 3.2, then deleted in 4.0. Should I fix it and add tests ? |
| return [ | ||
| [array_merge($record, ['datetime' =>new \DateTime('2019-01-01T00:01:00+00:00')]),1546300860], | ||
| [array_merge($record, ['datetime' =>'2019-01-01T00:01:00+00:00']),1546300860], | ||
| [array_merge($record, ['datetime' =>'foo']),false], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
What should the timestamp field contain ifdatetime is not a valid value ? As the DebugProcessor is not called before other processors, the data can be corrupted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
the original value could be the best
nicolas-grekas commentedNov 25, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
let's fix it then, branch 4.3 because 4.2 is not maintained anymore
I don't know, this looks good enough to me. |
nicolas-grekas commentedDec 10, 2019
Thank you@mRoca. |
This PR was merged into the 3.4 branch.Discussion----------[MonologBridge] Fix debug processor datetime type| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |n/a| License | MIT| Doc PR | n/aThis PR fixes an eventual `Call to a member function getTimestamp() on string` if any Processor transforms the `datetime` value, and uses the same record conditions as in the [ConsoleFormatter](https://github.com/symfony/monolog-bridge/blob/master/Formatter/ConsoleFormatter.php#L118 )Commits-------ffe3f10 [MonologBridge] Fix debug processor datetime type
Uh oh!
There was an error while loading.Please reload this page.
This PR fixes an eventual
Call to a member function getTimestamp() on stringif any Processor transforms thedatetimevalue, and uses the same record conditions as in theConsoleFormatter