code: func (handler *RotatingFileHandler) Handle(record *Record) error {
  	handler.lock.Lock()
  	defer handler.lock.Unlock()
  
  	msg := handler.Formatter.Format(record) + "\n"
  
  	if handler.needsRotation(msg) {
  		if err := handler.rotate(); err != nil {
  			return err
  		}
  
  		if err := handler.open(); err != nil {
  			return err
  		}
  	}
  
  	if handler.writer == nil {
  
  		if err := handler.open(); err != nil {
  			return err
  		}
  	}
  
  	_, err := handler.writer.Write([]byte(msg))
  	if err != nil {
  		return err
  	}
  	handler.writer.Flush()
  
  	return nil
  }
docs: // Handle writes message from log record into file.