original_string: public function log($level, $message, array $context = [])
      {
          if (!$this->_open) {
              $config = $this->_config;
              $this->_open($config['prefix'], $config['flag'], $config['facility']);
              $this->_open = true;
          }
  
          $priority = LOG_DEBUG;
          if (isset($this->_levelMap[$level])) {
              $priority = $this->_levelMap[$level];
          }
  
          $messages = explode("\n", $this->_format($message, $context));
          foreach ($messages as $message) {
              $message = sprintf($this->_config['format'], $level, $message);
              $this->_write($priority, $message);
          }
  
          return true;
      }
code: public function log($level, $message, array $context = [])
      {
          if (!$this->_open) {
              $config = $this->_config;
              $this->_open($config['prefix'], $config['flag'], $config['facility']);
              $this->_open = true;
          }
  
          $priority = LOG_DEBUG;
          if (isset($this->_levelMap[$level])) {
              $priority = $this->_levelMap[$level];
          }
  
          $messages = explode("\n", $this->_format($message, $context));
          foreach ($messages as $message) {
              $message = sprintf($this->_config['format'], $level, $message);
              $this->_write($priority, $message);
          }
  
          return true;
      }
code_tokens: public function log ( $ level , $ message , array $ context = [ ] ) { if ( ! $ this -> _open ) { $ config = $ this -> _config ; $ this -> _open ( $ config [ 'prefix' ] , $ config [ 'flag' ] , $ config [ 'facility' ] ) ; $ this -> _open = true ; } $ priority = LOG_DEBUG ; if ( isset ( $ this -> _levelMap [ $ level ] ) ) { $ priority = $ this -> _levelMap [ $ level ] ; } $ messages = explode ( "\n" , $ this -> _format ( $ message , $ context ) ) ; foreach ( $ messages as $ message ) { $ message = sprintf ( $ this -> _config [ 'format' ] , $ level , $ message ) ; $ this -> _write ( $ priority , $ message ) ; } return true ; }
docstring: Writes a message to syslog
  
  Map the $level back to a LOG_ constant value, split multi-line messages into multiple
  log messages, pass all messages through the format defined in the configuration
  
  @param string $level The severity level of log you are making.
  @param string $message The message you want to log.
  @param array $context Additional information about the logged message
  @return bool success of write.
docstring_tokens: Writes a message to syslog