code: func (l *Logger) openExistingOrNew(writeLen int) error {
  	l.mill()
  
  	filename := l.filename()
  	info, err := os_Stat(filename)
  	if os.IsNotExist(err) {
  		return l.openNew()
  	}
  	if err != nil {
  		return fmt.Errorf("error getting log file info: %s", err)
  	}
  
  	if info.Size()+int64(writeLen) >= l.max() {
  		return l.rotate()
  	}
  
  	file, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY, 0644)
  	if err != nil {
  		// if we fail to open the old log file for some reason, just ignore
  		// it and open a new log file.
  		return l.openNew()
  	}
  	l.file = file
  	l.size = info.Size()
  	return nil
  }
docs: // openExistingOrNew opens the logfile if it exists and if the current write
  // would not put it over MaxSize.  If there is no such file or the write would
  // put it over the MaxSize, a new file is created.