mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-05-27 12:52:27 +02:00
feat: capitalize all log messages for better readability
Capitalize the first letter of all log messages throughout the codebase to improve readability and consistency in logging output. Key improvements: - All log messages now start with capital letters - Consistent formatting across all logging statements - Improved readability for debugging and monitoring - Enhanced user experience with better formatted messages Files updated: - CLI commands and service management - Internal client information discovery - Network operations and configuration - DNS resolver and proxy operations - Platform-specific implementations This completes the final phase of the logging improvement project, ensuring all log messages follow consistent capitalization standards for better readability and professional appearance.
This commit is contained in:
committed by
Cuong Manh Le
parent
166b7f38fc
commit
d3b01dc7e8
+10
-10
@@ -94,9 +94,9 @@ func (m *mdns) init(quitCh chan struct{}) error {
|
||||
}
|
||||
|
||||
// Check if IPv6 is available once and use the result for the rest of the function.
|
||||
m.logger.Debug().Msgf("checking for IPv6 availability in mdns init")
|
||||
m.logger.Debug().Msgf("Checking for ipv6 availability in mdns init")
|
||||
ipv6 := ctrldnet.IPv6Available(context.Background())
|
||||
m.logger.Debug().Msgf("IPv6 is %v in mdns init", ipv6)
|
||||
m.logger.Debug().Msgf("ipv6 is %v in mdns init", ipv6)
|
||||
|
||||
v4ConnList := make([]*net.UDPConn, 0, len(ifaces))
|
||||
v6ConnList := make([]*net.UDPConn, 0, len(ifaces))
|
||||
@@ -130,11 +130,11 @@ func (m *mdns) probeLoop(conns []*net.UDPConn, remoteAddr net.Addr, quitCh chan
|
||||
for {
|
||||
err := m.probe(conns, remoteAddr)
|
||||
if shouldStopProbing(err) {
|
||||
m.logger.Warn().Msgf("stop probing %q: %v", remoteAddr, err)
|
||||
m.logger.Warn().Msgf("Stop probing %q: %v", remoteAddr, err)
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
m.logger.Warn().Err(err).Msg("error while probing mdns")
|
||||
m.logger.Warn().Err(err).Msg("Error while probing mdns")
|
||||
bo.BackOff(context.Background(), errors.New("mdns probe backoff"))
|
||||
continue
|
||||
}
|
||||
@@ -162,7 +162,7 @@ func (m *mdns) readLoop(conn *net.UDPConn) {
|
||||
if errors.Is(err, net.ErrClosed) {
|
||||
return
|
||||
}
|
||||
m.logger.Debug().Err(err).Msg("mdns readLoop error")
|
||||
m.logger.Debug().Err(err).Msg("Mdns readLoop error")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -185,11 +185,11 @@ func (m *mdns) readLoop(conn *net.UDPConn) {
|
||||
if ip != "" && name != "" {
|
||||
name = normalizeHostname(name)
|
||||
if val, loaded := m.name.LoadOrStore(ip, name); !loaded {
|
||||
m.logger.Debug().Msgf("found hostname: %q, ip: %q via mdns", name, ip)
|
||||
m.logger.Debug().Msgf("Found hostname: %q, ip: %q via mdns", name, ip)
|
||||
} else {
|
||||
old := val.(string)
|
||||
if old != name {
|
||||
m.logger.Debug().Msgf("update hostname: %q, ip: %q, old: %q via mdns", name, ip, old)
|
||||
m.logger.Debug().Msgf("Update hostname: %q, ip: %q, old: %q via mdns", name, ip, old)
|
||||
m.name.Store(ip, name)
|
||||
}
|
||||
}
|
||||
@@ -230,7 +230,7 @@ func (m *mdns) probe(conns []*net.UDPConn, remoteAddr net.Addr) error {
|
||||
// getDataFromAvahiDaemonCache reads entries from avahi-daemon cache to update mdns data.
|
||||
func (m *mdns) getDataFromAvahiDaemonCache() {
|
||||
if _, err := exec.LookPath("avahi-browse"); err != nil {
|
||||
m.logger.Debug().Err(err).Msg("could not find avahi-browse binary, skipping.")
|
||||
m.logger.Debug().Err(err).Msg("Could not find avahi-browse binary, skipping.")
|
||||
return
|
||||
}
|
||||
// Run avahi-browse to discover services from cache:
|
||||
@@ -240,7 +240,7 @@ func (m *mdns) getDataFromAvahiDaemonCache() {
|
||||
// - "-c" -> read from cache.
|
||||
out, err := exec.Command("avahi-browse", "-a", "-r", "-p", "-c").Output()
|
||||
if err != nil {
|
||||
m.logger.Debug().Err(err).Msg("could not browse services from avahi cache")
|
||||
m.logger.Debug().Err(err).Msg("Could not browse services from avahi cache")
|
||||
return
|
||||
}
|
||||
m.storeDataFromAvahiBrowseOutput(bytes.NewReader(out))
|
||||
@@ -260,7 +260,7 @@ func (m *mdns) storeDataFromAvahiBrowseOutput(r io.Reader) {
|
||||
name := normalizeHostname(fields[6])
|
||||
// Only using cache value if we don't have existed one.
|
||||
if _, loaded := m.name.LoadOrStore(ip, name); !loaded {
|
||||
m.logger.Debug().Msgf("found hostname: %q, ip: %q via avahi cache", name, ip)
|
||||
m.logger.Debug().Msgf("Found hostname: %q, ip: %q via avahi cache", name, ip)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user