code: func (l *LogWriter) Write(p []byte) (n int, err error) {
  	l.Lock()
  	defer l.Unlock()
  
  	// Strip off newlines at the end if there are any since we store
  	// individual log lines in the agent.
  	n = len(p)
  	if p[n-1] == '\n' {
  		p = p[:n-1]
  	}
  
  	l.logs[l.index] = string(p)
  	l.index = (l.index + 1) % len(l.logs)
  
  	for lh := range l.handlers {
  		lh.HandleLog(string(p))
  	}
  	return
  }
docs: // Write is used to accumulate new logs