61693[BUGFIX] Use correct log level integer / strings in admin panel
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Benjamin Franzke +1
- Markus Klein +1
- Jörg Bösche +1
-
Verified V +2 Done
- Georg Ringer +2
- Benjamin Franzke +1
- TYPO3com +1 CI
Issues 1
Files 3
Review log 1719
-
Susi Moog uploaded patch set 1 09/12/19, 07:58
-
Andreas Kienast voted on patch set 1 CR +1 09/12/19, 08:00
-
TYPO3com voted on patch set 1 V +1 09/12/19, 08:08 Completed build in 09m 23s on Thu, 12 Sep, 08:08 AM Test Summary: 47536 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36342
-
Markus Klein commented on patch set 1 09/12/19, 08:14
Thanks for the fix, this is interesting, because I introduced this migration code stuff explicitly. will review -
Susi Moog commented on patch set 1 09/12/19, 08:29
@Markus: The main problem is probably that LogRecord now has a string property for level and had an int in earlier versions. -
Markus Klein commented on patch set 1 09/12/19, 11:25
> Patch Set 1: > > @Markus: The main problem is probably that LogRecord now has a string property for level and had an int in earlier versions. I know, that's what Benni had fear of and I wrote the whole stuff to get that migration straight. Obviously I fu** that one class up. -
Markus Klein commented on patch set 1 09/12/19, 11:55
Log.php:157I'm too stupid to find the place where this array is crafted. If it is in \TYPO3\CMS\Adminpanel\Modules\Debug\Log::getDataToStore then 'level' should be an integer already -
Susi Moog commented on patch set 1 09/12/19, 12:07
Log.php:157Replyyes and no. Look at https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/adminpanel/Classes/Log/InMemoryLogWriter.php (which is the logWriter) - it makes use of the logging framework, so $logRecord is taken "as is" from the logging framework. Then, in https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/adminpanel/Classes/Modules/Debug/Log.php#L94, the only thing happening is an array conversion and removal of data from the logRecord to not bloat the storage - nothing is changed about the level here. The level config right above that part only stores available / configured levels. -
Markus Klein commented on patch set 1 V +1 CR +1 09/12/19, 12:57
Log.php:157Reply Unresolved> yes and no. Look at https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/adminpanel/Classes/Log/InMemoryLogWriter.php (which is the logWriter) - it makes use of the logging framework, so $logRecord is taken "as is" from the logging framework. Then, in https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/adminpanel/Classes/Modules/Debug/Log.php#L94, the only thing happening is an array conversion and removal of data from the logRecord to not bloat the storage - nothing is changed about the level here. The level config right above that part only stores available / configured levels. Thanks Susi -
Benjamin Franzke commented on patch set 1 V -1 09/13/19, 18:38
When logging a string value like \Psr\Log\LogLevel::ALERT following exception is thrown: Argument 1 passed to TYPO3\CMS\Core\Log\LogLevel::getName() must be of the type int, string given, called in […]/typo3/sysext/adminpanel/Classes/ViewHelpers/SpeakingLogLevelViewHelper.php on line 61 Log Module fails with Argument 1 passed to TYPO3\CMS\Core\Log\LogLevel::getName() must be of the type int, string given, called in […]/typo3/sysext/adminpanel/Classes/ViewHelpers/SpeakingLogLevelViewHelper.php on line 61 Will investigate and push an update. -
Markus Klein voted on patch set 1 V 0 CR 0 09/13/19, 19:49
-
Benjamin Franzke uploaded patch set 2 09/13/19, 19:51
-
Benjamin Franzke commented on patch set 2 V +1 CR +1 09/13/19, 19:54
I've now removed the SpeakingLogLevelViewHelper as it is a) wrong to expect integer values because, b) we do only retrieve string log levels (due to normalization) from the Logging framework, which means c) we do no longer need to "pretty" print the log level, as it is readable as is. -
Benjamin Franzke commented on patch set 2 09/13/19, 19:59
One more info: Patchset 1 worked when enabling both, "Group by Component" *and* "Group by Level" (as the view helper was not used in that case), all others did not. With patchset 2, the other three cases (Group by Component, Group by Level, no grouping) work as well. -
TYPO3com voted on patch set 2 V +1 09/13/19, 20:01 Completed build in 09m 31s on Fri, 13 Sep, 08:01 PM Test Summary: 47556 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36441
-
Markus Klein voted on patch set 2 CR +1 09/13/19, 23:24
-
Jörg Bösche voted on patch set 2 CR +1 09/18/19, 20:47
-
Georg Ringer voted on patch set 2 V +2 CR +2 09/19/19, 04:20
-
Georg Ringer merged patch set 3 09/19/19, 04:20