public static function addLogger(Logger $logger, ?string $name = null, bool $overwrite = false)
    {
        $name = $name ?: $logger->getName();

        if (isset(self::$loggers[$name]) && !$overwrite) {
            throw new InvalidArgumentException('Logger with the given name already exists');
        }

        self::$loggers[$name] = $logger;
    }
public static function addLogger(Logger $logger, ?string $name = null, bool $overwrite = false)
    {
        $name = $name ?: $logger->getName();

        if (isset(self::$loggers[$name]) && !$overwrite) {
            throw new InvalidArgumentException('Logger with the given name already exists');
        }

        self::$loggers[$name] = $logger;
    }
public static function addLogger ( Logger $ logger , ? string $ name = null , bool $ overwrite = false ) { $ name = $ name ? : $ logger -> getName ( ) ; if ( isset ( self :: $ loggers [ $ name ] ) && ! $ overwrite ) { throw new InvalidArgumentException ( 'Logger with the given name already exists' ) ; } self :: $ loggers [ $ name ] = $ logger ; }
Adds new logging channel to the registry

@param  Logger                    $logger    Instance of the logging channel
@param  string|null               $name      Name of the logging channel ($logger->getName() by default)
@param  bool                      $overwrite Overwrite instance in the registry if the given name already exists?
@throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists
Adds new logging channel to the registry