misc: each module now has its own tagged logging

This commit is contained in:
evilsocket 2019-02-12 15:16:02 +01:00
commit 9cd4e380fb
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
47 changed files with 343 additions and 349 deletions

View file

@ -5,7 +5,6 @@ import (
"io"
"time"
"github.com/bettercap/bettercap/log"
"github.com/bettercap/bettercap/session"
"github.com/adrianmo/go-nmea"
@ -24,7 +23,7 @@ type GPS struct {
func NewGPS(s *session.Session) *GPS {
gps := &GPS{
SessionModule: session.NewSessionModule("http.server", s),
SessionModule: session.NewSessionModule("gps", s),
serialPort: "/dev/ttyUSB0",
baudRate: 19200,
}
@ -136,10 +135,10 @@ func (gps *GPS) Start() error {
gps.Session.GPS = m
}
} else {
log.Debug("Error parsing line '%s': %s", line, err)
gps.Debug("error parsing line '%s': %s", line, err)
}
} else if err != io.EOF {
log.Warning("Error while reading serial port: %s", err)
gps.Warning("error while reading serial port: %s", err)
}
}
})