// Fire forwards an error to LogHook
767078
func (hook *logHook) Fire(entry *logrus.Entry) error {
	addr := strings.Split(hook.Mail.Addr, ":")
	if len(addr) != 2 {
		return errors.New("invalid Mail Address")
	}
	host := addr[0]
	subject := fmt.Sprintf("[%s] %s: %s", entry.Level, host, entry.Message)

	html := `
	{{.Message}}

	{{range $key, $value := .Data}}
	{{$key}}: {{$value}}
	{{end}}
	`
	b := bytes.NewBuffer(make([]byte, 0))
	t := template.Must(template.New("mail body").Parse(html))
	if err := t.Execute(b, entry); err != nil {
		return err
	}
	body := b.String()

	return hook.Mail.sendMail(subject, body)
}
891158
func (elk *UDPHook) Fire(e *log.Entry) error {
	// Make a copy to safely modify
	entry := e.WithFields(nil)
	if cursor := findFrame(); cursor != nil {
		t := newTraceFromFrames(*cursor, nil)
		entry.Data[FileField] = t.String()
		entry.Data[FunctionField] = t.Func()
	}
	data, err := json.Marshal(Frame{
		Time:    elk.Clock.Now().UTC(),
		Type:    "trace",
		Entry:   entry.Data,
		Message: entry.Message,
		Level:   entry.Level.String(),
	})
	if err != nil {
		return Wrap(err)
	}

	conn, err := net.ListenPacket("udp", ":0")
	if err != nil {
		return Wrap(err)
	}
	defer conn.Close()

	resolvedAddr, err := net.ResolveUDPAddr("udp", "127.0.0.1:5000")
	if err != nil {
		return Wrap(err)
	}

	_, err = (conn.(*net.UDPConn)).WriteToUDP(data, resolvedAddr)
	return Wrap(err)

}
303723
func (logger *Logger) Errorf(m string, args ...interface{}) {
	logger.log(ERROR, m, args...)
}
892577
func LogErrorf(format string, v ...interface{}) error {
	err := fmt.Errorf(format, v...)
	if LogLevel >= 1 {
		DoLog(3, ERROR, err.Error())
	}
	return err
}
1358481
func (logger *Logger) Error(args ...interface{}) {
	logger.log(ERROR, fmt.Sprint(args...))
}
165545
func (l *intLogger) Error(msg string, args ...interface{}) {
	l.Log(Error, msg, args...)
}
1195379
func (l *Logger) Error(v ...interface{}) {
	if l.Level >= ErrorLevel {
		l.Logger.Print(ErrorLevel.String() + fmt.Sprint(v...))
	}
}
747218
func (s *StanLogger) Errorf(format string, v ...interface{}) {
	s.executeLogCall(func(log Logger, format string, v ...interface{}) {
		log.Errorf(format, v...)
	}, format, v...)
}
373062
func handleHook(a HookAction, err error) {
	if err != nil {
		// TODO: handle errors
	}

	switch a {
	case HookActionContinue:
		return
	case HookActionHalt:
		panic(HookActionHalt)
	}
}
1218799
func Error(logger log.Logger) log.Logger {
	return log.WithPrefix(logger, Key(), ErrorValue())
}
1242796
func (p *BearyChatHook) Fire(e *logrus.Entry) (err error) {
	color := ""
	switch e.Level {
	case logrus.DebugLevel:
		color = "#FDFEFE"
	case logrus.InfoLevel:
		color = "#5DADE2"
	case logrus.ErrorLevel, logrus.FatalLevel, logrus.PanicLevel:
		color = "#FF0000"
	default:
		color = "#FFFF00"
	}

	req := &bearychat.Message{
		Text:     e.Message,
		Markdown: p.Markdown,
		Channel:  p.Channel,
		User:     p.User,
	}

	var attachs []bearychat.Attachment

	if len(e.Data) > 0 {

		for k, v := range e.Data {
			attach := bearychat.Attachment{}

			attach.Title = k
			attach.Text = fmt.Sprint(v)
			attach.Color = color

			attachs = append(attachs, attach)
		}
	}

	req.Attachments = attachs

	if p.Async {
		go p.cli.Send(p.Url, req)
		return
	}

	_, err = p.cli.Send(p.Url, req)
	return
}
973101
func (l *Logger) Error(msg string) {
	l.errorLogger.Log(l.messageKey, msg)
}
719383
func (l *DefaultLogger) Error(msg string, args ...interface{}) error {
	return l.extractLogError(LevelError, msg, args)
}
1037717
func (l *Log) Error(args ...interface{}) {
	opts := getLoggerOpts(l.module, api.ERROR)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Error(args...)
		return
	}
	l.log(opts, api.ERROR, args...)
}
1339129
func (g *GRPCLogger) Errorf(format string, args ...interface{}) {
	g.Error(fmt.Sprintf(format, args...))
}
460992
func (t LoggerType) Errorf(format string, a ...interface{}) {
	text := fmt.Sprintf(format, a...)

	msgopts, err := t.options.Formatter.formatSkip(text, 1, true)
	if err != nil {
		t.options.FallbackLogger.Trace(ErrSlackFormatFailed1.New(err, text))
		return
	}

	t.sendMessage(t.options.ChannelError, msgopts...)
}
874932
func (l *Logger) Error(msg string, fields map[string]interface{}) error {
	return l.Log(LvError, msg, fields)
}