func (cw *ConnWriter) Destroy() {
	if cw.innerWriter == nil {
		return
	}
	cw.innerWriter.Close()
}
destroy connection writer and close tcp listener.
package log
import (
	"encoding/json"
	"io"
	"log"
	"net"
)
type ConnWriter struct {
	lg             *log.Logger
	innerWriter    io.WriteCloser
	ReconnectOnMsg bool   `json:"reconnectOnMsg"`
	Reconnect      bool   `json:"reconnect"`
	Net            string `json:"net"`
	Addr           string `json:"addr"`
	Level          int    `json:"level"`
}
func NewConn() LoggerInterface {
	conn := new(ConnWriter)
	conn.Level = TRACE
	return conn
}
func (cw *ConnWriter) Init(jsonconfig string) error {
	return json.Unmarshal([]byte(jsonconfig), cw)
}
func (cw *ConnWriter) WriteMsg(msg string, skip, level int) error {
	if cw.Level > level {
		return nil
	}
	if cw.neddedConnectOnMsg() {
		if err := cw.connect(); err != nil {
			return err
		}
	}
	if cw.ReconnectOnMsg {
		defer cw.innerWriter.Close()
	}
	cw.lg.Println(msg)
	return nil
}
func (_ *ConnWriter) Flush() {
}