Fix handling of logger calls in lib/private/Log.php#40844
Conversation
dea6860 to
40ae632
Compare
|
I don't see any unit tests for |
|
Should we write a crash log if we can't write in the log file? Although it's a weird case that shouldn't happen, if it happens I don't think we'll notice. |
|
💥 Acceptance tests pipeline cliBackground-maria10.2-php7.4 failed. The build has been cancelled. |
if the logger object has no Do I just add and |
eb05455 to
dc9ac6f
Compare
|
We can try to throw an exception and see how it behaves. If the exception is unhandled, it should end up in the crash log (https://github.com/search?q=repo%3Aowncloud%2Fcore%20crashlog&type=code). |
dc9ac6f to
5965fd9
Compare
|
I added an If I adjust the code locally so that that happens, then I get this output: That works for |
|
Kudos, SonarCloud Quality Gate passed! |
|
Confirmed fixed in 10.13.0-rc.1 |









Description
Try to run a background job with verbose output.
Before this PR:
Errors are logged to
owncloud.logand the verbose output is not displayed.After this PR:
The verbose output is displayed and no errors are written to
owncloud.logSome things pass a real
OCP\ILoggerclass to the "old"lib/private/Log.phpOCP\ILoggerdoes not have methodswriteExtraorwrite, so it fails when trying to callwriteThis PR adds more logic so that it calls the
logmethod if that exists.This should be backward-compatible with whatever currently calls
lib/private/Log.phpand haswriteExtraandwritemethods.Related Issue
I noticed this because I was looking at owncloud/files_antivirus#378
How Has This Been Tested?
See fixed command output above.
Added an acceptance test for the
background:queue:executecommand (there was not one yet)Types of changes
Checklist: