code: func initLogRotator(logFile string) {
  	logDir, _ := filepath.Split(logFile)
  	err := os.MkdirAll(logDir, 0700)
  	if err != nil {
  		fmt.Fprintf(os.Stderr, "failed to create log directory: %v\n", err)
  		os.Exit(1)
  	}
  	r, err := rotator.New(logFile, 10*1024, false, 3)
  	if err != nil {
  		fmt.Fprintf(os.Stderr, "failed to create file rotator: %v\n", err)
  		os.Exit(1)
  	}
  
  	logRotator = r
  }
docs: // initLogRotator initializes the logging rotater to write logs to logFile and
  // create roll files in the same directory.  It must be called before the
  // package-global log rotater variables are used.