chore: align logging
Some checks failed
Some checks failed
This commit is contained in:
parent
12f3221aed
commit
8b52365011
4 changed files with 5 additions and 5 deletions
|
|
@ -101,7 +101,7 @@ func (l *Listener) listen() {
|
|||
}
|
||||
|
||||
body := strings.TrimSpace(string(b[:read]))
|
||||
l.log.TRACE.Printf("recv from %s %v", addr.String(), body)
|
||||
l.log.TRACE.Printf("recv %s: %v", addr.String(), body)
|
||||
|
||||
msg := UDPMsg{
|
||||
Addr: addr.String(),
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ func NewSender(log *util.Logger, addr string) (*Sender, error) {
|
|||
|
||||
// Send msg to receiver
|
||||
func (c *Sender) Send(msg string) error {
|
||||
c.log.TRACE.Printf("send to %s %v", c.addr, msg)
|
||||
c.log.TRACE.Printf("send %s: %v", c.addr, msg)
|
||||
_, err := io.Copy(c.conn, strings.NewReader(msg))
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ func (m *Server) listen() {
|
|||
m.log.ERROR.Println(err)
|
||||
continue
|
||||
}
|
||||
m.log.TRACE.Printf("recv from %s: % X", addr, buf[:n])
|
||||
m.log.TRACE.Printf("recv %s: % X", addr, buf[:n])
|
||||
|
||||
ip := addr.IP.String()
|
||||
monitor := m.GetInverter(ip)
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ func (p *AA55UDP) sendRecv(packet []byte) ([]byte, error) {
|
|||
g.wait(p.delay)
|
||||
}
|
||||
|
||||
p.log.TRACE.Printf("send to %s: %x", p.conn.RemoteAddr(), packet)
|
||||
p.log.TRACE.Printf("send %s: %x", p.conn.RemoteAddr(), packet)
|
||||
|
||||
if _, err := p.conn.Write(packet); err != nil {
|
||||
return nil, fmt.Errorf("write: %w", err)
|
||||
|
|
@ -185,7 +185,7 @@ func (p *AA55UDP) sendRecv(packet []byte) ([]byte, error) {
|
|||
return nil, fmt.Errorf("read: %w", err)
|
||||
}
|
||||
|
||||
p.log.TRACE.Printf("recv from %s: %x", p.conn.RemoteAddr(), buf[:n])
|
||||
p.log.TRACE.Printf("recv %s: %x", p.conn.RemoteAddr(), buf[:n])
|
||||
|
||||
return buf[:n], nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue