private function configureLogger(ErrorHandler $handler, LoggerInterface $logger, $loggedAt)
    {
        // Set real logger for the levels specified.
        $handler->setDefaultLogger($logger, $loggedAt);

        // For all the levels not logged, tell the handler not to log them.
        $notLoggedLevels = [];
        $defaults = [
            E_DEPRECATED        => null,
            E_USER_DEPRECATED   => null,
            E_NOTICE            => null,
            E_USER_NOTICE       => null,
            E_STRICT            => null,
            E_WARNING           => null,
            E_USER_WARNING      => null,
            E_COMPILE_WARNING   => null,
            E_CORE_WARNING      => null,
            E_USER_ERROR        => null,
            E_RECOVERABLE_ERROR => null,
            E_COMPILE_ERROR     => null,
            E_PARSE             => null,
            E_ERROR             => null,
            E_CORE_ERROR        => null,
        ];
        if (is_array($loggedAt)) {
            $notLoggedLevels = array_diff_key($defaults, $loggedAt);
        } else {
            if ($loggedAt === 0) { // shortcut for no logging.
                $notLoggedLevels = $defaults;
            } elseif ($loggedAt === E_ALL) { // shortcut for all logging.
                // Do nothing. Leave notLoggedLevels empty.
            } else {
                foreach ($defaults as $type => $logger) {
                    if (!($loggedAt & $type)) {
                        $notLoggedLevels[$type] = null;
                    }
                }
            }
        }
        if ($notLoggedLevels) {
            $handler->setLoggers($notLoggedLevels);
        }
    }
private function configureLogger(ErrorHandler $handler, LoggerInterface $logger, $loggedAt)
    {
        // Set real logger for the levels specified.
        $handler->setDefaultLogger($logger, $loggedAt);

        // For all the levels not logged, tell the handler not to log them.
        $notLoggedLevels = [];
        $defaults = [
            E_DEPRECATED        => null,
            E_USER_DEPRECATED   => null,
            E_NOTICE            => null,
            E_USER_NOTICE       => null,
            E_STRICT            => null,
            E_WARNING           => null,
            E_USER_WARNING      => null,
            E_COMPILE_WARNING   => null,
            E_CORE_WARNING      => null,
            E_USER_ERROR        => null,
            E_RECOVERABLE_ERROR => null,
            E_COMPILE_ERROR     => null,
            E_PARSE             => null,
            E_ERROR             => null,
            E_CORE_ERROR        => null,
        ];
        if (is_array($loggedAt)) {
            $notLoggedLevels = array_diff_key($defaults, $loggedAt);
        } else {
            if ($loggedAt === 0) { // shortcut for no logging.
                $notLoggedLevels = $defaults;
            } elseif ($loggedAt === E_ALL) { // shortcut for all logging.
                // Do nothing. Leave notLoggedLevels empty.
            } else {
                foreach ($defaults as $type => $logger) {
                    if (!($loggedAt & $type)) {
                        $notLoggedLevels[$type] = null;
                    }
                }
            }
        }
        if ($notLoggedLevels) {
            $handler->setLoggers($notLoggedLevels);
        }
    }
private function configureLogger ( ErrorHandler $ handler , LoggerInterface $ logger , $ loggedAt ) { // Set real logger for the levels specified. $ handler -> setDefaultLogger ( $ logger , $ loggedAt ) ; // For all the levels not logged, tell the handler not to log them. $ notLoggedLevels = [ ] ; $ defaults = [ E_DEPRECATED => null , E_USER_DEPRECATED => null , E_NOTICE => null , E_USER_NOTICE => null , E_STRICT => null , E_WARNING => null , E_USER_WARNING => null , E_COMPILE_WARNING => null , E_CORE_WARNING => null , E_USER_ERROR => null , E_RECOVERABLE_ERROR => null , E_COMPILE_ERROR => null , E_PARSE => null , E_ERROR => null , E_CORE_ERROR => null , ] ; if ( is_array ( $ loggedAt ) ) { $ notLoggedLevels = array_diff_key ( $ defaults , $ loggedAt ) ; } else { if ( $ loggedAt === 0 ) { // shortcut for no logging. $ notLoggedLevels = $ defaults ; } elseif ( $ loggedAt === E_ALL ) { // shortcut for all logging. // Do nothing. Leave notLoggedLevels empty. } else { foreach ( $ defaults as $ type => $ logger ) { if ( ! ( $ loggedAt & $ type ) ) { $ notLoggedLevels [ $ type ] = null ; } } } } if ( $ notLoggedLevels ) { $ handler -> setLoggers ( $ notLoggedLevels ) ; } }
Configure the error handler to log types given to the logger given and to ignore all types not specified.

It's important that the BufferingLogger is completely replaced for all error types with either a real logger
or null, otherwise a memory leak could occur.

@param ErrorHandler    $handler
@param LoggerInterface $logger
@param array|int       $loggedAt An array map of E_* to LogLevel::* or an integer bit field of E_* constants
Configure the error handler to log types given to the logger given and to ignore all types not specified .