code: func (agent *Agent) configureLogging(ctx context.Context) (context.Context, error) {
  	log := fmt.Sprintf("agent.%s.log", strconv.FormatInt(time.Now().Unix(), 10))
  	if err := os.MkdirAll(agent.logsDir, 0755); err != nil {
  		return ctx, err
  	}
  
  	// TODO(smut): Capture logging emitted before configureLogging was called and
  	// write it to the log file.
  	out, err := os.OpenFile(filepath.Join(agent.logsDir, log), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
  	if err != nil {
  		return ctx, err
  	}
  	config := gologger.LoggerConfig{Out: out}
  	return teelogger.Use(ctx, config.NewLogger), nil
  }
docs: // configureLogging configures logging to a file, in addition to any other logging.
  //
  // Returns modified context.Context.