original_string: public function onMessage(MessageEvent $e)
      {
          $formatter = $this->getFormatter();
          $adapterKey = $e->getAdapter()->getKey();
          $level = $e->getLevel();
          $message = $e->getMessage();
  
          $match = '/\r\n?/';
  
          //check if the message has weird formatting before trying to format it (currently a hack to avoid segmentation faults)
          if (!preg_match($match, $message)) {
              $msg = sprintf(
                  "%s (%s): %s",
                  $formatter->formatBlock($adapterKey, 'info'),
                  $formatter->formatBlock($level, 'comment'),
                  $message
              );
          } else {
              $msg = sprintf(
                  "%s (%s): %s",
                  $adapterKey,
                  $level,
                  preg_replace('/\r\n?/', '', $message)
              );
          }
  
          $this->getOutput()->writeln($msg);
      }
code: public function onMessage(MessageEvent $e)
      {
          $formatter = $this->getFormatter();
          $adapterKey = $e->getAdapter()->getKey();
          $level = $e->getLevel();
          $message = $e->getMessage();
  
          $match = '/\r\n?/';
  
          //check if the message has weird formatting before trying to format it (currently a hack to avoid segmentation faults)
          if (!preg_match($match, $message)) {
              $msg = sprintf(
                  "%s (%s): %s",
                  $formatter->formatBlock($adapterKey, 'info'),
                  $formatter->formatBlock($level, 'comment'),
                  $message
              );
          } else {
              $msg = sprintf(
                  "%s (%s): %s",
                  $adapterKey,
                  $level,
                  preg_replace('/\r\n?/', '', $message)
              );
          }
  
          $this->getOutput()->writeln($msg);
      }
code_tokens: public function onMessage ( MessageEvent $ e ) { $ formatter = $ this -> getFormatter ( ) ; $ adapterKey = $ e -> getAdapter ( ) -> getKey ( ) ; $ level = $ e -> getLevel ( ) ; $ message = $ e -> getMessage ( ) ; $ match = '/\r\n?/' ; //check if the message has weird formatting before trying to format it (currently a hack to avoid segmentation faults) if ( ! preg_match ( $ match , $ message ) ) { $ msg = sprintf ( "%s (%s): %s" , $ formatter -> formatBlock ( $ adapterKey , 'info' ) , $ formatter -> formatBlock ( $ level , 'comment' ) , $ message ) ; } else { $ msg = sprintf ( "%s (%s): %s" , $ adapterKey , $ level , preg_replace ( '/\r\n?/' , '' , $ message ) ) ; } $ this -> getOutput ( ) -> writeln ( $ msg ) ; }
docstring: Write any messages received by an adapter
docstring_tokens: Write any messages received by an adapter