original_string: public function setDefaultLogger(LoggerInterface $logger, $levels = E_ALL, $replace = false)
      {
          $loggers = [];
  
          if (\is_array($levels)) {
              foreach ($levels as $type => $logLevel) {
                  if (empty($this->loggers[$type][0]) || $replace || $this->loggers[$type][0] === $this->bootstrappingLogger) {
                      $loggers[$type] = [$logger, $logLevel];
                  }
              }
          } else {
              if (null === $levels) {
                  $levels = E_ALL;
              }
              foreach ($this->loggers as $type => $log) {
                  if (($type & $levels) && (empty($log[0]) || $replace || $log[0] === $this->bootstrappingLogger)) {
                      $log[0] = $logger;
                      $loggers[$type] = $log;
                  }
              }
          }
  
          $this->setLoggers($loggers);
      }
code: public function setDefaultLogger(LoggerInterface $logger, $levels = E_ALL, $replace = false)
      {
          $loggers = [];
  
          if (\is_array($levels)) {
              foreach ($levels as $type => $logLevel) {
                  if (empty($this->loggers[$type][0]) || $replace || $this->loggers[$type][0] === $this->bootstrappingLogger) {
                      $loggers[$type] = [$logger, $logLevel];
                  }
              }
          } else {
              if (null === $levels) {
                  $levels = E_ALL;
              }
              foreach ($this->loggers as $type => $log) {
                  if (($type & $levels) && (empty($log[0]) || $replace || $log[0] === $this->bootstrappingLogger)) {
                      $log[0] = $logger;
                      $loggers[$type] = $log;
                  }
              }
          }
  
          $this->setLoggers($loggers);
      }
code_tokens: public function setDefaultLogger ( LoggerInterface $ logger , $ levels = E_ALL , $ replace = false ) { $ loggers = [ ] ; if ( \ is_array ( $ levels ) ) { foreach ( $ levels as $ type => $ logLevel ) { if ( empty ( $ this -> loggers [ $ type ] [ 0 ] ) || $ replace || $ this -> loggers [ $ type ] [ 0 ] === $ this -> bootstrappingLogger ) { $ loggers [ $ type ] = [ $ logger , $ logLevel ] ; } } } else { if ( null === $ levels ) { $ levels = E_ALL ; } foreach ( $ this -> loggers as $ type => $ log ) { if ( ( $ type & $ levels ) && ( empty ( $ log [ 0 ] ) || $ replace || $ log [ 0 ] === $ this -> bootstrappingLogger ) ) { $ log [ 0 ] = $ logger ; $ loggers [ $ type ] = $ log ; } } } $ this -> setLoggers ( $ loggers ) ; }
docstring: Sets a logger to non assigned errors levels.
  
  @param LoggerInterface $logger  A PSR-3 logger to put as default for the given levels
  @param array|int       $levels  An array map of E_* to LogLevel::* or an integer bit field of E_* constants
  @param bool            $replace Whether to replace or not any existing logger
docstring_tokens: Sets a logger to non assigned errors levels .