func (c *connWriter) WriteMsg(when time.Time, msg string, level int) error {
	if level > c.Level {
		return nil
	}
	if c.needToConnectOnMsg() {
		err := c.connect()
		if err != nil {
			return err
		}
	}
	if c.ReconnectOnMsg {
		defer c.innerWriter.Close()
	}
	c.lg.println(when, msg)
	return nil
}
WriteMsg write message in connection.
if connection is down, try to re-connect.
package logs
import (
	"encoding/json"
	"io"
	"net"
	"time"
)
type connWriter struct {
	lg             *logWriter
	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() Logger {
	conn := new(connWriter)
	conn.Level = LevelTrace
	return conn
}
func (c *connWriter) Init(jsonConfig string) error {
	return json.Unmarshal([]byte(jsonConfig), c)
}