Back to Log class

Method createDelegatedLogger

public static \Joomla\CMS\Log\DelegatingPsrLogger
createDelegatedLogger
()
Creates a delegated PSR-3 compatible logger from the current singleton instance. This method always returns a new delegated logger.
Returns
  • \Joomla\CMS\Log\DelegatingPsrLogger
Since
  • 3.8.0
Class: Log
Project: Joomla

Method createDelegatedLogger - Source code

/**
 * Creates a delegated PSR-3 compatible logger from the current singleton instance. This method always returns a new delegated logger.
 *
 * @return  DelegatingPsrLogger
 *
 * @since   3.8.0
 */
public static function createDelegatedLogger()
{
    // Ensure a singleton instance has been created first
    if (empty(static::$instance)) {
        static::setInstance(new static());
    }
    return new DelegatingPsrLogger(static::$instance);
}