feat: Refactor ILogger::* constants to PSR log levels#6
feat: Refactor ILogger::* constants to PSR log levels#6ChristophWurst wants to merge 1 commit intomainfrom
Conversation
Signed-off-by: Christoph Wurst <[email protected]>
| return null; | ||
| } | ||
| $methodCallName = $this->getName($node->name); | ||
| if ($methodCallName !== 'log') { |
There was a problem hiding this comment.
If it’s only for log method maybe we should directly replace with the proper method? debug/error/whatever?
There was a problem hiding this comment.
You are right. If someone uses the logger with a static log level it should be the dedicated method anyway.
The use case to migrate with this rector is the use of dynamic log levels. For example in https://github.com/nextcloud/server/pull/47510/files.
This means we don't even need a custom rector. We can just replace the ILogger constant with a LogLevel constant.
There was a problem hiding this comment.
But that does not work in all situations I think. If an app is using the ILogger:: constant to compare against log content or configured loglevel, it needs the ILogger one and not the LogLevel one.
This is why we intend on undeprecating ILogger:: const in 31.
See nextcloud/server#47978
Ref nextcloud/server#47293
cc @susnux