package nt

/// zap logger sinker
/// write msg to mq

type MqSink struct {
	name string
}

func NewMqSink(name string) *MqSink {
	return &MqSink{
		name:name,
	}
}

func (self *MqSink) Write(p []byte) (int, error) {
	subject := ZkP.Namespace + ".log." + self.name
	err := Mq.AsyncPub(subject, p)
	return len(p), err
}

func (self *MqSink) Sync() error {
	return nil
}

func (self *MqSink) Close() error {
	return nil
}