User tests: Successful: Unsuccessful:
Make the registerLogger-method static, so somebody can use it to register custom loggers using custom namespaces. Currently, one needs to use the Joomla-namespace, which is not ideal.
The other methods in this class are already static, I assume this is just something which was forgotten.
Make the registerLogger-method static, so somebody can use it to register custom loggers.
None. This method is unused in Joomla so far.
I can't add custom loggers
I can add custom loggers with a non-Joomla namespace
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Category | ⇒ | Libraries |
Status | New | ⇒ | Pending |
Title |
|
@carlitorweb Thank you for the hint. Joomla\CMS\Log\Log::registerLogger
uses Joomla\CMS\Log\LoggerRegistry::register
and keeps a LoggerRegistry as singleton. I could not find a place where the LoggerRegistry was used differently. I'm sure I missed that spot. Can you point me to an example, please?
I have tested this item
Makes sense.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
PR-4.3-dev
|
RTC
Status | Ready to Commit | ⇒ | Needs Review |
Putting this on needs review as it is a BC break. Please introduce a new function and then deprecate this one for 6.0.
I understand that making a method static is an API change. In this case, it is nearly impossible to call that method directly. The method is not used across the Joomla source code, and for extensions it is impossible to call it since one needs an instance of Log
, which has a protected constructor.
@laoneo Anyway, I'm fine with a new method if this is required. I just need some ideas on the naming. I guess registerLogger2
is not a good name ;) Any idea for a better one? It finally needs to step into the place of registerLogger
But you can extend the Log class and then call that function, or?
How do you know my code? ;) You're right.
But joking aside, what would be a good name? registerLogger_static
? Are you aware of any good example in the Joomla-world?
@svenbluege How about registerCustomLogger
? I think it could be a good name.
This pull request has been automatically rebased to 5.0-dev. No new features will be merged into Joomla! 4.3 series. Joomla! 4.4 series is a bridge release to make migration from Joomla! 4 to 5 as smooth as possible.
Labels |
Added:
Feature
PR-5.0-dev
Removed: PR-4.3-dev |
This pull request has been automatically rebased to 5.1-dev.
This pull request has been automatically rebased to 5.2-dev.
Title |
|
This pull request has been automatically rebased to 5.3-dev.
Title |
|
In fact this function you mention should be deprecated in favor of
Joomla\CMS\Log\LoggerRegistry::register