// PanicIfErrWrite is similar to PanicIfErr, but works well with io results that return integer+err
197447
func PanicIfErrWrite(numWritten int, err error) {
	if err != nil {
		panic(fmt.Sprintf("Write err: %s", err.Error()))
	}
}
450884
func (l *Logger) Panicln(v ...interface{}) {
	s := fmt.Sprintln(v...)
	_ = l.Output(FATAL, 4, s)
	panic(s)
}
1340082
func Panicln(v ...interface{}) {
	s := fmt.Sprintln(v...)
	_ = std.Output(FATAL, 4, s)
	panic(s)
}
540748
func panicRecover(f func(w dns.ResponseWriter, r *dns.Msg)) func(w dns.ResponseWriter, r *dns.Msg) {
	return func(w dns.ResponseWriter, r *dns.Msg) {
		defer func() {
			if rec := recover(); rec != nil {
				m := new(dns.Msg)
				m.SetRcode(r, 2)
				if err := w.WriteMsg(m); err != nil {
					logging.Error.Println(err)
				}
				logging.Error.Println(rec)
			}
		}()
		f(w, r)
	}
}
650492
func (w *BroadcastWriter) Write(p []byte) (n int, err error) {
	for _, writer := range w.writers {
		n, err = writer.Write(p)
		if err != nil {
			return
		}
		if n != len(p) {
			err = io.ErrShortWrite
			return
		}
	}
	return len(p), nil
}
520636
func (a *Arguments) Panicf(format string, v ...interface{}) {
	panic(fmt.Errorf(format, v...))
}
1316151
func (w *errorWriter) Write(p []byte) (n int, err error) {
	s := string(p)
	if s[len(s)-1] == '\n' {
		s = s[:len(s)-1]
	}
	w.l.print(GetOutputs().ErrorOut, 6, "ERROR", s)
	return len(p), nil
}
324113
func (logs *Logs) Panicf(format string, v ...interface{}) {
	logs.allf(format, v...)
	logs.Flush()
	panic(fmt.Sprintf(format, v...))
}
573747
func (entry *Entry) Panicf(format string, args ...interface{}) {
	if entry.lgEntry.Logger.Level >= lg.PanicLevel {
		entry.lgEntry.WithFields(entry.fields).Panicf(format, args...)
	}
}
1201740
func (f *roFile) Write(p []byte) (n int, err error) {
	return 0, ErrReadOnly
}
857564
func (mBatch *goLevelDBBatch) Write() {
	err := mBatch.db.db.Write(mBatch.batch, &opt.WriteOptions{Sync: false})
	if err != nil {
		panic(err)
	}
}
1260013
func (c *circbufWriter) Write(p []byte) (nn int, err error) {
	// If the last write returned an error, return it here. Note there is a
	// small chance of missing an error if multiple writes occure at the same
	// time where the last write nils out the error before it can be returned
	// here.
	c.bufLock.Lock()
	defer c.bufLock.Unlock()
	if c.err != nil {
		return nn, c.err
	}

	// Write to the buffer
	nn, err = c.buf.Write(p)

	// Signal to flush the buffer
	select {
	case c.flushCh <- struct{}{}:
	default:
		// flush is blocked
	}
	return nn, err
}
177616
func Writer(w io.Writer) (io.Writer, func()) {
	var out = os.Stderr
	if f, ok := w.(*os.File); ok && f == os.Stderr {
		out = os.Stdout
	}
	sprk := Spark(time.Millisecond * 33)
	sprk.Units = Bytes
	sprk.Out = out
	started := false
	return writer(func(b []byte) (int, error) {
		if !started {
			sprk.Start()
			started = true
		}
		n, err := w.Write(b)
		if err == nil {
			sprk.Add(float64(n))
		} else {
			sprk.Stop()
		}
		return n, err
	}), sprk.Stop
}
1336105
func (ec *EpollConsole) signalWrite() {
	ec.writec.L.Lock()
	ec.writec.Signal()
	ec.writec.L.Unlock()
}
18798
func (lr loggerRewrite) Write(p []byte) (n int, err error) {
	if !lr.hideDeprecated {
		p = append(log_deprecated, p...)
	}
	n = len(p)
	if len(p) > 0 && p[n-1] == '\n' {
		p = p[:n-1]
		n--
	}

	switch lr.Level {
	case log15.LvlInfo:
		lr.Logger.Info(string(p))
	case log15.LvlDebug:
		lr.Logger.Debug(string(p))
	case log15.LvlWarn:
		lr.Logger.Warn(string(p))
	case log15.LvlError:
		lr.Logger.Error(string(p))
	case log15.LvlCrit:
		lr.Logger.Crit(string(p))
	}

	return
}
211539
func PanicIfErr(err error, msg string, args ...interface{}) {
	if err != nil {
		panic(fmt.Sprintf("%s: %s", err.Error(), fmt.Sprintf(msg, args...)))
	}
}
377429
func ErrorWriter() io.Writer {
	return &ColorWriter{w: os.Stderr, fd: os.Stderr.Fd(), mutex: &stdErrMutex, lastFgColor: fgWhite}
}