// printMsg prints message string or JSON structure depending on the type of output console.
424311
func printMsg(msg message) {
	if !globalJSON {
		console.Println(msg.String())
	} else {
		console.Println(msg.JSON())
	}
}
1318723
func (z *NestOuter) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 1
	// write "inner"
	err = en.Append(0x81, 0xa5, 0x69, 0x6e, 0x6e, 0x65, 0x72)
	if err != nil {
		return
	}
	if z.Inner == nil {
		err = en.WriteNil()
		if err != nil {
			return
		}
	} else {
		// map header, size 1
		// write "hello"
		err = en.Append(0x81, 0xa5, 0x68, 0x65, 0x6c, 0x6c, 0x6f)
		if err != nil {
			return
		}
		err = en.WriteString(z.Inner.Hello)
		if err != nil {
			return
		}
	}
	return
}
592907
func (z *bitmapContainer) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 2
	// string "cardinality"
	o = append(o, 0x82, 0xab, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79)
	o = msgp.AppendInt(o, z.cardinality)
	// string "bitmap"
	o = append(o, 0xa6, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70)
	o = msgp.AppendArrayHeader(o, uint32(len(z.bitmap)))
	for zxvk := range z.bitmap {
		o = msgp.AppendUint64(o, z.bitmap[zxvk])
	}
	return
}
1053249
func (n *Notification) EncodeMsg(w *msgp.Writer) error {
	var bm msgp.Encodable

	if n.Body != nil {
		var ok bool
		bm, ok = n.Body.(msgp.Encodable)
		if !ok {
			return ErrNotEncodable
		}
	}

	var err error

	if err = w.WriteArrayHeader(NotificationPackSize); err != nil {
		return err
	}

	if err = w.WriteInt(NotificationType); err != nil {
		return err
	}

	if err = w.WriteString(n.Method); err != nil {
		return err
	}

	// No body to encode. Write a zero-length params array.
	if bm == nil {
		return w.WriteArrayHeader(0)
	}

	// 1-item array containing the body.
	if err = w.WriteArrayHeader(1); err != nil {
		return err
	}

	return msgp.Encode(w, bm)
}
509472
func (s *ScrubWriter) WriteMsg(m *dns.Msg) error {
	state := Request{Req: s.req, W: s.ResponseWriter}

	n := state.Scrub(m)
	state.SizeAndDo(n)
	return s.ResponseWriter.WriteMsg(n)
}
1250285
func (w *fileLogWriter) WriteMsg(when time.Time, msg string, level int) error {
	if level > w.Level {
		return nil
	}
	h, d := formatTimeHeader(when)
	msg = string(h) + msg + "\n"
	if w.Rotate {
		w.RLock()
		if w.needRotate(len(msg), d) {
			w.RUnlock()
			w.Lock()
			if w.needRotate(len(msg), d) {
				if err := w.doRotate(when); err != nil {
					fmt.Fprintf(os.Stderr, "FileLogWriter(%q): %s\n", w.Filename, err)
				}
			}
			w.Unlock()
		} else {
			w.RUnlock()
		}
	}

	w.Lock()
	_, err := w.fileWriter.Write([]byte(msg))
	if err == nil {
		w.maxLinesCurLines++
		w.maxSizeCurSize += len(msg)
	}
	w.Unlock()
	return err
}
1150796
func (w *Writer) WriteMsg(res *dns.Msg) error {
	w.Msg = res
	return nil
}
215461
func (m *Msg) String() string {
	return fmt.Sprintf("Msg(%d) %v->%v", m.Code, m.One.TerminalString(), m.Other.TerminalString())
}
41058
func (p *MsgPipeRW) ReadMsg() (Msg, error) {
	if atomic.LoadInt32(p.closed) == 0 {
		select {
		case msg := <-p.r:
			return msg, nil
		case <-p.closing:
		}
	}
	return Msg{}, ErrPipeClosed
}
1245976
func (z *Session) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 1
	// string "v"
	o = append(o, 0x81, 0xa1, 0x76)
	o = msgp.AppendMapHeader(o, uint32(len(z.Values)))
	for xvk, bzg := range z.Values {
		o = msgp.AppendString(o, xvk)
		o, err = msgp.AppendIntf(o, bzg)
		if err != nil {
			return
		}
	}
	return
}
893048
func (z *IterGen) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 3
	// string "T0"
	o = append(o, 0x83, 0xa2, 0x54, 0x30)
	o = msgp.AppendUint32(o, z.T0)
	// string "IntervalHint"
	o = append(o, 0xac, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x48, 0x69, 0x6e, 0x74)
	o = msgp.AppendUint32(o, z.IntervalHint)
	// string "B"
	o = append(o, 0xa1, 0x42)
	o = msgp.AppendBytes(o, z.B)
	return
}
1132318
func (z *roaringArray) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 4
	// string "keys"
	o = append(o, 0x84, 0xa4, 0x6b, 0x65, 0x79, 0x73)
	o = msgp.AppendArrayHeader(o, uint32(len(z.keys)))
	for zhct := range z.keys {
		o = msgp.AppendUint16(o, z.keys[zhct])
	}
	// string "needCopyOnWrite"
	o = append(o, 0xaf, 0x6e, 0x65, 0x65, 0x64, 0x43, 0x6f, 0x70, 0x79, 0x4f, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65)
	o = msgp.AppendArrayHeader(o, uint32(len(z.needCopyOnWrite)))
	for zcua := range z.needCopyOnWrite {
		o = msgp.AppendBool(o, z.needCopyOnWrite[zcua])
	}
	// string "copyOnWrite"
	o = append(o, 0xab, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65)
	o = msgp.AppendBool(o, z.copyOnWrite)
	// string "conserz"
	o = append(o, 0xa7, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x72, 0x7a)
	o = msgp.AppendArrayHeader(o, uint32(len(z.conserz)))
	for zxhx := range z.conserz {
		// map header, size 2
		// string "t"
		o = append(o, 0x82, 0xa1, 0x74)
		o = msgp.AppendUint8(o, uint8(z.conserz[zxhx].t))
		// string "r"
		o = append(o, 0xa1, 0x72)
		o, err = z.conserz[zxhx].r.MarshalMsg(o)
		if err != nil {
			return
		}
	}
	return
}
139850
func (z *GraphiteTagDelSeries) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 2
	// write "Paths"
	err = en.Append(0x82, 0xa5, 0x50, 0x61, 0x74, 0x68, 0x73)
	if err != nil {
		return
	}
	err = en.WriteArrayHeader(uint32(len(z.Paths)))
	if err != nil {
		err = msgp.WrapError(err, "Paths")
		return
	}
	for za0001 := range z.Paths {
		err = en.WriteString(z.Paths[za0001])
		if err != nil {
			err = msgp.WrapError(err, "Paths", za0001)
			return
		}
	}
	// write "Propagate"
	err = en.Append(0xa9, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x65)
	if err != nil {
		return
	}
	err = en.WriteBool(z.Propagate)
	if err != nil {
		err = msgp.WrapError(err, "Propagate")
		return
	}
	return
}
537885
func (z *Node) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 4
	// string "id"
	o = append(o, 0x84, 0xa2, 0x69, 0x64)
	o = msgp.AppendBytes(o, []byte(z.ID))
	// string "il"
	o = append(o, 0xa2, 0x69, 0x6c)
	o = msgp.AppendBool(o, z.IsLeaf)
	// string "cv"
	o = append(o, 0xa2, 0x63, 0x76)
	o = msgp.AppendArrayHeader(o, uint32(len(z.ChildValues)))
	for cmr := range z.ChildValues {
		o, err = msgp.AppendIntf(o, z.ChildValues[cmr])
		if err != nil {
			return
		}
	}
	// string "ck"
	o = append(o, 0xa2, 0x63, 0x6b)
	o = msgp.AppendArrayHeader(o, uint32(len(z.ChildKeys)))
	for ajw := range z.ChildKeys {
		if z.ChildKeys[ajw] == nil {
			o = msgp.AppendNil(o)
		} else {
			o, err = z.ChildKeys[ajw].MarshalMsg(o)
			if err != nil {
				return
			}
		}
	}
	return
}
624334
func Print(err error) string {
	return fmt.Sprintf("%v: %v\n", Code(err), err.Error())
}
61688
func (l *Logger) InfoMsg(message string, keyvals ...interface{}) error {
	return Msg(l.Info, message, keyvals...)
}
471325
func (u uiErr) Msg(m string, args ...interface{}) uiErr {
	return uiErr{
		msg:    fmt.Sprintf(m, args...),
		detail: u.detail,
		action: u.action,
		help:   u.help,
	}
}