Flush the log queue to the log file.
161965
public function flush()
    {
        if (null == $this->buildLogFile) {
            $this->resetLogQueue();

            return;
        }
        $messageElements = array();
        for ($i = count($this->logQueue) - 1; $i >= 0; --$i) {
            $message = $this->logQueue[$i];
            $messageString = '<message priority="'.$message->priority.'" ';
            $messageString .= 'timestamp="'.$message->timestamp.'" ';
            $messageString .= 'time="'.date('Y-m-d H:i:s - T', $message->timestamp).'"><![CDATA[';
            $messageString .= base64_encode($message->message);
            $messageString .= ']]></message>';

            $messageElements[] = $messageString;
        }

        $previousLogMessages = '';

        $dirName = dirname($this->buildLogFile);
        if (!file_exists($dirName)) {
            mkdir($dirName, 0755, true);
        }
        if (file_exists($this->buildLogFile)) {
            // copying to temporary file for later inclusion via fgets, less memory consuming
            copy($this->buildLogFile, $this->buildLogFile.'.temp');
        }
        $fh = fopen($this->buildLogFile, 'w+');
        if (is_resource($fh)) {
            fputs($fh, '<?xml version="1.0"?>');
            fputs($fh, "\n");
            fputs($fh, '<build>');
            fputs($fh, "\n");
            fputs($fh, implode("\n", $messageElements));
            fputs($fh, "\n");
            if (file_exists($this->buildLogFile.'.temp')) {
                $fht = fopen($this->buildLogFile.'.temp', 'r');
                if (is_resource($fht)) {
                    $lineCounter = 0;
                    while ($line = fgets($fht)) {
                        // skip first two lines (xml decl and build opening element
                        if ($lineCounter > 2) {
                            fputs($fh, $line);
                        }
                        ++$lineCounter;
                    }
                    fclose($fht);
                    unlink($this->buildLogFile.'.temp');
                } else {
                    self::error('Cannot include previous log messages');
                }
            } else {
                fputs($fh, '</build>');
            }
            //fputs($fh, $previousLogMessages);
            fclose($fh);
            //file_put_contents($this->buildLogFile, $buildXml);
        } else {
            self::error('Cannot open: '.$this->buildLogFile.' for writing.');
        }
        $this->resetLogQueue();
    }
265502
function flush() {
    if (queue) {
      result.push(queue)

      if (handleText) {
        handleText.call(textContext, queue, {start: prev, end: now()})
      }

      queue = ''
    }
  }
283243
def flush(self):
        """"""
        for name in self.item_names:
            item = self[name]
            item.flush()
        self.file.flush()
1359769
def flush(self):
        '''
        '''
        with self._lock:
            if self._closed:
                raise IOError('Writer is closed')
            self._byte_queue.join()
            self._writer.flush()
408449
public void flush()
  {
    if (!enabled)
    {
      return;
    }
    if (!queue.isEmpty())
    {
      // start a new thread to upload without blocking the current thread
      Runnable runUpload = new TelemetryUploader(this, exportQueueToString());
      uploader.execute(runUpload);
    }
  }
717108
def flush(self):
        """"""
        if self._num_outstanding_events == 0 or self._recordio_writer is None:
            return
        self._recordio_writer.flush()
        if self._logger is not None:
            self._logger.info('wrote %d %s to disk', self._num_outstanding_events,
                              'event' if self._num_outstanding_events == 1 else 'events')
        self._num_outstanding_events = 0
512624
private void flushEventBuffer() {
        Holder<T> holder = buffer.get();
        logger.accept(holder.getBuffer().get());
        holder.clear();
    }
1055506
def _flush(self, finish=False):
    
    while ((finish and self._buffered >= 0) or
           (not finish and self._buffered >= self._blocksize)):
      tmp_buffer = []
      tmp_buffer_len = 0

      excess = 0
      while self._buffer:
        buf = self._buffer.popleft()
        size = len(buf)
        self._buffered -= size
        tmp_buffer.append(buf)
        tmp_buffer_len += size
        if tmp_buffer_len >= self._maxrequestsize:
          excess = tmp_buffer_len - self._maxrequestsize
          break
        if not finish and (
            tmp_buffer_len % self._blocksize + self._buffered <
            self._blocksize):
          excess = tmp_buffer_len % self._blocksize
          break

      if excess:
        over = tmp_buffer.pop()
        size = len(over)
        assert size >= excess
        tmp_buffer_len -= size
        head, tail = over[:-excess], over[-excess:]
        self._buffer.appendleft(tail)
        self._buffered += len(tail)
        if head:
          tmp_buffer.append(head)
          tmp_buffer_len += len(head)

      data = ''.join(tmp_buffer)
      file_len = '*'
      if finish and not self._buffered:
        file_len = self._written + len(data)
      self._send_data(data, self._written, file_len)
      self._written += len(data)
      if file_len != '*':
        break
523158
def flush(self):
        """"""
        self.__flushLevel(0)
        if self.__lastImport is not None:
            self.imports.append(self.__lastImport)
951197
def _flush(self):
        
        # Flush buffer to specified range
        buffer = self._get_buffer()
        start = self._buffer_size * (self._seek - 1)
        end = start + len(buffer)

        future = self._workers.submit(
            self._flush_range, buffer=buffer, start=start, end=end)
        self._write_futures.append(future)
        future.add_done_callback(partial(self._update_size, end))
1203632
private void flushBuffer() {
		// Do the actual logging:
		removes.ensureCapacity(buffer.size());
		for(Iterator<LoggingEvent> i = buffer.iterator(); i.hasNext();) {
			try {
				LoggingEvent event = (LoggingEvent)i.next();
				doLog(event);
				removes.add(event);
			} catch(Exception e) {
				errorHandler.error("Failed to flush log", e, ErrorCode.FLUSH_FAILURE);
			}
		}

		// Remove from the buffer any events that were reported:
		buffer.removeAll(removes);

		// Clear the buffer of reported events:
		removes.clear();
	}
1172875
void flushBuffer() throws IOException {
        synchronized (lock) {
            ensureOpen();
            if (nextChar == 0)
                return;
            out.write(cb, 0, nextChar);
            nextChar = 0;
        }
    }
786303
def flush(self):
        """"""
        self._check_open_file()
        if self.allow_update and not self.is_stream:
            contents = self._io.getvalue()
            if self._append:
                self._sync_io()
                old_contents = (self.file_object.byte_contents
                                if is_byte_string(contents) else
                                self.file_object.contents)
                contents = old_contents + contents[self._flush_pos:]
                self._set_stream_contents(contents)
                self.update_flush_pos()
            else:
                self._io.flush()
            if self.file_object.set_contents(contents, self._encoding):
                if self._filesystem.is_windows_fs:
                    self._changed = True
                else:
                    current_time = time.time()
                    self.file_object.st_ctime = current_time
                    self.file_object.st_mtime = current_time
            self._file_epoch = self.file_object.epoch

            if not self.is_stream:
                self._flush_related_files()
59195
def flush(self, *args, **kwgs):
        
        if settings['LOG_RESPONSE'] and not self._status_code == 500:
            log_response(self)

        super(BaseHandler, self).flush(*args, **kwgs)
1279913
def flush(self):
    """"""
    self.acquire()
    try:
      self.stream.flush()
    except (EnvironmentError, ValueError):
      # A ValueError is thrown if we try to flush a closed file.
      pass
    finally:
      self.release()
883072
public void flushBuffer()
    throws IOException
    {
        if (logger.isLoggable(Level.FINER)) logger.entering(className, "flushBuffer()");

        if (this.osWriter != null)
        {
            this.osWriter.flush();
        }

        if (logger.isLoggable(Level.FINER)) logger.exiting(className, "flushBuffer()");
    }
399951
public static function flush() {
    if (isset(self::$app_log_group)) {
      $req = new FlushRequest();
      $req->setLogs(self::$app_log_group->serializeToString());
      $resp = new VoidProto();
      ApiProxy::makeSyncCall('logservice', 'Flush', $req, $resp);
      self::$app_log_group->clear();
      self::$last_flush_time = microtime(true);
    }
  }