-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MonologBridge] Fix debug processor datetime type #34601
Conversation
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.
Target branch is now 3.4, and tests have been added. The bug is still present in the DebugHandler, 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 if datetime
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
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. |
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/a This 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
This PR fixes an eventual
Call to a member function getTimestamp() on string
if any Processor transforms thedatetime
value, and uses the same record conditions as in the ConsoleFormatter