code: func (l *AuditLog) EmitAuditEvent(event Event, fields EventFields) error {
  	// If an external logger has been set, use it as the emitter, otherwise
  	// fallback to the local disk based emitter.
  	var emitAuditEvent func(event Event, fields EventFields) error
  	if l.ExternalLog != nil {
  		emitAuditEvent = l.ExternalLog.EmitAuditEvent
  	} else {
  		emitAuditEvent = l.localLog.EmitAuditEvent
  	}
  
  	// Emit the event. If it fails for any reason a Prometheus counter is
  	// incremented.
  	err := emitAuditEvent(event, fields)
  	if err != nil {
  		auditFailedEmit.Inc()
  		return trace.Wrap(err)
  	}
  
  	return nil
  }
docs: // EmitAuditEvent adds a new event to the log. If emitting fails, a Prometheus
  // counter is incremented.